Kotlin / kotlin-jupyter

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

Backend Internal error: Exception during file facade code generation #356

Closed holgerbrandl closed 2 years ago

holgerbrandl commented 2 years ago

Consider the following example:

sealed class ShiftID

object WeekEnd : ShiftID()

val shiftModel = sequence {
   yield(WeekEnd)
}

open class ShiftManager {
    val shiftIt = shiftModel.iterator()
}

class InterruptingShiftManager: ShiftManager() {

}

Expected: It's legit kotlin , so it should run in a jupyter notebook.

Observed: It fails with

Backend Internal error: Exception during file facade code generation
File being compiled: mock://Line_49.jupyter-kts
The root cause java.lang.RuntimeException was thrown at: org.jetbrains.kotlin.codegen.ImplementationBodyCodegen.generateConstructors(ImplementationBodyCodegen.java:472)

kernel version: Kotlin kernel v. 0.11.0.45, Kotlin v. 1.6.20-dev-6372

ileasile commented 2 years ago

This specific issue was fixed in recent versions of Kotlin. However, InterruptingShiftManager still cannot be instantiated due to #355 :(

holgerbrandl commented 2 years ago

Thanks for the quick fix and the thorough analysis. I keep my fingers crossed regarding top-level variables.