Skip to content

ScriptREPL is not usable - problem with variables named as Scala keywords #9

Closed
@jpsacha

Description

@jpsacha

Cannot evaluate any Scala code in ScriptREPL due to error:

-- [E032] Syntax Error: --------------------------------------------------------
212 |val object : org.scijava.object.DefaultObjectService = {
    |    ^^^^^^
    |    pattern expected
    |
    | longer explanation available when compiling with `-explain`
java.lang.ClassNotFoundException: rs$line$0
	at dotty.tools.repl.AbstractFileClassLoader.findClass(AbstractFileClassLoader.scala:51)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
...

One of the variables passed from ScriptREPL to ScalaAdaptedScriptEngine is called object leading to internal error in binding variables.

The can be addressed, on Scala side, using name in backticks while binding. In this case Scala variable would be called `object`.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions