I am playing a little bit with kotlin-jupyter and ...
# datascience
m
I am playing a little bit with kotlin-jupyter and I am getting exception after simple
typealias Matrix = List<List<Double>>
Crash is in thread. It is of course working if I define it as a class.
Copy code
class kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedTypeAliasDescriptor cannot be cast to class kotlin.reflect.jvm.internal.impl.descriptors.ClassDescriptor (kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedTypeAliasDescriptor and kotlin.reflect.jvm.internal.impl.descriptors.ClassDescriptor are in unnamed module of loader 'app')
java.lang.ClassCastException: class kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedTypeAliasDescriptor cannot be cast to class kotlin.reflect.jvm.internal.impl.descriptors.ClassDescriptor (kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedTypeAliasDescriptor and kotlin.reflect.jvm.internal.impl.descriptors.ClassDescriptor are in unnamed module of loader 'app')
	at kotlin.reflect.jvm.internal.KClassImpl$Data$nestedClasses$2.invoke(KClassImpl.kt:102)
	at kotlin.reflect.jvm.internal.KClassImpl$Data$nestedClasses$2.invoke(KClassImpl.kt:47)
	at kotlin.reflect.jvm.internal.ReflectProperties$LazySoftVal.invoke(ReflectProperties.java:92)
	at kotlin.reflect.jvm.internal.ReflectProperties$Val.getValue(ReflectProperties.java:31)
	at kotlin.reflect.jvm.internal.KClassImpl$Data.getNestedClasses(KClassImpl.kt)
	at kotlin.reflect.jvm.internal.KClassImpl.getNestedClasses(KClassImpl.kt:240)
	at org.jetbrains.kotlinx.jupyter.codegen.ClassAnnotationsProcessorImpl.process(ClassAnnotationsProcessorImpl.kt:19)
	at org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl$execute$1$2.invoke(CellExecutorImpl.kt:77)
	at org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl$execute$1$2.invoke(CellExecutorImpl.kt:76)
	at org.jetbrains.kotlinx.jupyter.config.LoggingKt.catchAll(logging.kt:41)
	at org.jetbrains.kotlinx.jupyter.config.LoggingKt.catchAll$default(logging.kt:40)
	at org.jetbrains.kotlinx.jupyter.repl.impl.CellExecutorImpl.execute(CellExecutorImpl.kt:76)
	at org.jetbrains.kotlinx.jupyter.repl.CellExecutor$DefaultImpls.execute$default(CellExecutor.kt:13)
	at org.jetbrains.kotlinx.jupyter.ReplForJupyterImpl$eval$1.invoke(repl.kt:373)
	at org.jetbrains.kotlinx.jupyter.ReplForJupyterImpl$eval$1.invoke(repl.kt:363)
	at org.jetbrains.kotlinx.jupyter.ReplForJupyterImpl.withEvalContext(repl.kt:348)
	at org.jetbrains.kotlinx.jupyter.ReplForJupyterImpl.eval(repl.kt:363)
	at org.jetbrains.kotlinx.jupyter.ProtocolKt$shellMessagesHandler$res$1.invoke(protocol.kt:291)
	at org.jetbrains.kotlinx.jupyter.ProtocolKt$shellMessagesHandler$res$1.invoke(protocol.kt:290)
	at org.jetbrains.kotlinx.jupyter.JupyterConnection$runExecution$execThread$1.invoke(connection.kt:162)
	at org.jetbrains.kotlinx.jupyter.JupyterConnection$runExecution$exec
Thread$1.invoke(connection.kt:160)
	at kotlin.concurrent.ThreadsKt$thread$thread$1.run(Thread.kt:30)
Any idea? Should I create a YT issue?
r
Probably, yeah, or perhaps at https://github.com/Kotlin/kotlin-jupyter
I can't tell which is causing it
a
Yes, it seems to be a #scripting bug. cc @ilya.chernikov
i
I'm not able to reproduce it with a regular script:
Copy code
❯ cat m.kts
typealias Matrix = List<List<Double>>
val m: Matrix = listOf(listOf(0.1))
println(m)
❯ kotlin m.kts
[[0.1]]
as well as in the default REPL, so, please report to https://github.com/Kotlin/kotlin-jupyter first. (cc: @Ilya Muradyan)
i
@ilya.chernikov it fails on calling
(scriptInstance::class).nestedClasses
where
scriptInstance
is an instance of the above script. So it may be an issue with class generation or something like that. I'll investigate it a bit later
👍 1