.kts scripts - unresolved reference: bindings
I have a kotlin script to which I am passing some bindings (depending on what my main program is doing):
scriptEngine.eval(scriptContent, scriptEngine.createBindings().apply { putAll(bindings) })
In my .kts script I need to use the "bindings" variable to access the variables I've passed to the .kts script.
Unfortunately IntelliJ doesn't recognize bindings[] and all code cannot compile (unresolved reference: bindings)
If i run everything from the command line - it works, so I consider this to be mainly an IDE issue.
Any suggestions ?
请先登录再写评论。