https://kotlinlang.org logo
#scripting
Title
# scripting
s

SrSouza

01/24/2019, 5:19 PM
@ilya.chernikov Hi, when a should use
ScriptEvaluationConfigurationKeys.constructorArgs
? My code loads the script and return to me a KClass, no a new object from the compiled script
Copy code
val evalConfig = ScriptEvaluationConfiguration {
        constructorArgs(plugin)
        set(JvmScriptEvaluationConfiguration.actualClassLoader, bukkriptClassLoader)
    }

    val clazz = bukkriptCompiledScript.compiledScript.getClass(evalConfig).resultOrSeveral(plugin)
In this case a should not use
constructorArgs()
?
i

ilya.chernikov

01/24/2019, 5:22 PM
If you construct your class yourself, you don’t need it. If you’re using evaluator that constructs the class for you, then you should supply it with constructor args (if there are any) via evaluation configuration.
s

SrSouza

01/24/2019, 5:40 PM
Okay, tkx 😊