-
Notifications
You must be signed in to change notification settings - Fork 105
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
Can not use object expresssions #341
Comments
@holgerbrandl thanks for reporting! It seems to be one more problem of scripts code generation, but can be easily workarounded on kernel side. I'll try to provide a better solution on scripting side later. |
The downside of this workaround is that if you have defined a renderer for type |
@holgerbrandl @altavir try updating to |
Works in DataLore on |
Just to remember: reproducer in Kotlin fun testAnonymousObjectReflection() {
JvmTestRepl()
.use { repl ->
assertEvalResult(repl, "42", 42)
assertEvalUnit(repl, "val sim = object : ArrayList<String>() {}")
val compiledSnippet = checkCompile(repl, "sim")
val evalResult = repl.eval(compiledSnippet!!)
val a = (evalResult.valueOrThrow().get().result as ResultValue.Value).value!!
assertTrue(a::class.isSubclassOf(Any::class))
}
} |
Works like charm now. Thank you so much for your great and blazingly fast support. |
Consider the following example
When using
sim
in a second code-cell this fails with:Since object expressions are a very useful tool when prototyping (i.e. working with notebooks), it would be most wonderful if this language feature could be fixed/enabled for the kernel.
Used kernel version: Kotlin kernel v. 0.10.3.20, Kotlin v. 1.6.20-dev-3702
The text was updated successfully, but these errors were encountered: