starke
10/23/2021, 12:19 AM@file:Import
when running a script in the IDE. Getting this error when trying to add @file:Import("script1.main.kts")
to script2.main.kts
error: backend Internal error: Exception during IR lowering
File being compiled: development/script1.main.kts
The root cause java.lang.RuntimeException was thrown at: org.jetbrains.kotlin.backend.jvm.codegen.FunctionCodegen.generate(FunctionCodegen.kt:50) (script2.main.kts): org.jetbrains.kotlin.backend.common.BackendException: Backend Internal error: Exception during IR lowering
File being compiled: development/script1.main.kts
The root cause java.lang.RuntimeException was thrown at: org.jetbrains.kotlin.backend.jvm.codegen.FunctionCodegen.generate(FunctionCodegen.kt:50)
I saw this thread that suggested using useOldBackend
until the bug is fixed, but I couldn’t figure out how to set this flag when running the script in the IDE.
It also mentioned that the bug might be fixed in the kotlin 1.6 release, but I can’t find any documentation about how to specify the kotlin version for a kotlin-main-kts
script 🤔 I wanted to try Kotlin 1.6.0-RC to see if the bug disappears, but I’m not sure how to define the script’s kotlin version.
Thanks in advance!Big Chungus
10/23/2021, 12:36 AMstarke
10/25/2021, 12:30 AMuseOldBackend
?Nikky
10/27/2021, 11:04 AM@file:CompilerOptions("-Xuse-old-backend")