Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jpsacha opened this issue May 13, 2023 · 0 comments
Closed
Assignees
Labels

Comments

@jpsacha
Copy link
Member

jpsacha commented May 13, 2023

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`.

@jpsacha jpsacha added the bug label May 13, 2023
@jpsacha jpsacha self-assigned this May 13, 2023
@jpsacha jpsacha closed this as completed May 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant