kotlin-jupyter
kotlin-jupyter copied to clipboard
Cannot use a library with a dependency on Kotlin compiler
@file:DependsOn("com.lemonappdev:konsist:0.13.0")
import com.lemonappdev.konsist.api.*
import com.lemonappdev.konsist.api.declaration.*
val functions = Konsist.scopeFromProduction()
.functions()
Issue can be narrowed down to this code. Even though both classes are present in the same kotlin-compiler artifact, kernel throws exception
@file:DependsOn("org.jetbrains.kotlin:kotlin-compiler:1.9.10")
org.jetbrains.kotlin.idea.KotlinFileType.INSTANCE as com.intellij.openapi.fileTypes.FileType
Looks like classes are loaded by a different ClassLoaders due to this https://github.com/Kotlin/kotlin-jupyter/blob/ac355e90e9cd5f3ffc147eafc591c4f1fc29070a/src/main/kotlin/org/jetbrains/kotlinx/jupyter/repl.kt#L348C30-L348C30