Skip to content

JSR 223 binding no longer works in Scala 3, worked in Scala 2 #17237

Open
@jpsacha

Description

@jpsacha

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions