My compiler plugin module uses Kotlin 2.2.20, but ...
# compiler
c
My compiler plugin module uses Kotlin 2.2.20, but when I run my test fixtures, I get the error
UNSUPPORTED_FEATURE: The feature "break continue in inline lambdas" is only available since language version 2.2 (36,36) in /withoutState.kt
. Does anyone know why this feature isn't working? EDIT: Apparently
AbstractIrBlackBoxCodegenTest
pins the language version to
1.9
. Not sure why. The way to suppress the diagnostic is to add
// LANGUAGE: +BreakContinueInInlineLambdas
to the test file.
✅ 1
y
You can also set the language version, I believe. I never ran into this, though, which is strange. I have tests that use context parameters, which weren't a thing pre K2 at all.
d
Do not use
AbstractIrBlackBoxCodegenTest
. It's a test runner for the old K1 compiler. The proper runner you need is
AbstractFirLightTreeBlackBoxCodegenTest
.
👍 1
c
@dmitriy.novozhilov Even when testing a purely IR plugin? Does the FIR backend do everything needed in both IR and bytecode?
y
Yes.You have to go thru some frontend no matter what. The original Kotlin frontend does not support any language features past 1.9.
👍 1
👌 1