Open
Description
Compiler version
Tested with 3.2.2, but likely broken in other Scala 3 versions
Minimized code
This code should execute simple statement println(a)
and print value 1
val eng = new ScriptEngineManager().getEngineByName("scala")
eng.put("a", 1)
eng.eval("println(a)")
Output
Execution of eng.eval("println(a)")
results in error:
-- [E006] Not Found Error: -----------------------------------------------------
1 |println(b)
| ^
| Not found: b
|
| longer explanation available when compiling with `-explain`
1 error found
Expectation
In this case, a value a
, set to 1
, should be passed to the ScriptEngine evaluating the script, through binding. Script should compile and execute without errors.