Kotlin / kotlin-jupyter

Kotlin kernel for Jupyter/IPython
Apache License 2.0
1.1k stars 105 forks source link

An internal error when evaluating code with syntax errors #347

Closed strangepleasures closed 2 years ago

strangepleasures commented 2 years ago

Evaluate something like break = 1 or return. Instead of reporting a syntax error, the kernel will produce this:

Could not initialize class org.jetbrains.kotlin.diagnostics.rendering.DefaultErrorMessages
org.jetbrains.kotlinx.jupyter.repl.impl.JupyterCompilerImpl.compileSync(JupyterCompilerImpl.kt:171)
org.jetbrains.kotlinx.jupyter.repl.impl.InternalEvaluatorImpl.eval(InternalEvaluatorImpl.kt:95)
org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl$execute$1$result$1.invoke(CellExecutorImpl.kt:64)
org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl$execute$1$result$1.invoke(CellExecutorImpl.kt:63)
org.jetbrains.kotlinx.jupyter.ReplForJupyterImpl.withHost(repl.kt:596)
org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl.execute(CellExecutorImpl.kt:63)
org.jetbrains.kotlinx.jupyter.repl.CellExecutor$DefaultImpls.execute$default(CellExecutor.kt:13)
org.jetbrains.kotlinx.jupyter.ReplForJupyterImpl$evalEx$1.invoke(repl.kt:419)
org.jetbrains.kotlinx.jupyter.ReplForJupyterImpl$evalEx$1.invoke(repl.kt:408)
org.jetbrains.kotlinx.jupyter.ReplForJupyterImpl.withEvalContext(repl.kt:372)
org.jetbrains.kotlinx.jupyter.ReplForJupyterImpl.evalEx(repl.kt:408)
org.jetbrains.kotlinx.jupyter.ReplForJupyterImpl.eval(repl.kt:456)
org.jetbrains.kotlinx.jupyter.ProtocolKt$shellMessagesHandler$res$1.invoke(protocol.kt:290)
org.jetbrains.kotlinx.jupyter.ProtocolKt$shellMessagesHandler$res$1.invoke(protocol.kt:289)
org.jetbrains.kotlinx.jupyter.JupyterConnection$runExecution$execThread$1.invoke(connection.kt:166)
org.jetbrains.kotlinx.jupyter.JupyterConnection$runExecution$execThread$1.invoke(connection.kt:164)
kotlin.concurrent.ThreadsKt$thread$thread$1.run(Thread.kt:30)
strangepleasures commented 2 years ago

Obsolete. Works fine in 0.11.0.16