Closed benkuly closed 2 years ago
Your branch doesn't have IR enable in the repository, but it seems a strange one indeed. Clearly a bug in the (still experimental) JS IR backend.
Your branch doesn't have IR enable in the repository, but it seems a strange one indeed. Clearly a bug in the (still experimental) JS IR backend.
IR is enabled (for JS explicitly and native for default as far as I know): https://gitlab.com/benkuly/trixnity/-/blob/ir-compiler-issues/trixnity-core/build.gradle.kts
@benkuly Odd, I had to fiddle about to get it to work.
Do you have an idea? I could make a PR, but I don't know where to start...
With Kotlin 1.5.30 this does also affect the jvm target with the following exception. I also updated the example branch linked above.
org.jetbrains.kotlin.backend.common.BackendException: Backend Internal error: Exception during IR lowering
File being compiled: /home/benkuly/repos/trixnity/trixnity-core/src/commonMain/kotlin/net/folivo/trixnity/core/model/events/UnsignedData.kt
The root cause java.lang.RuntimeException was thrown at: org.jetbrains.kotlin.backend.jvm.codegen.FunctionCodegen.generate(FunctionCodegen.kt:50)
at org.jetbrains.kotlin.backend.common.CodegenUtil.reportBackendException(CodegenUtil.kt:239)
at org.jetbrains.kotlin.backend.common.CodegenUtil.reportBackendException$default(CodegenUtil.kt:235)
at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invokeSequential(performByIrFile.kt:68)
at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invoke(performByIrFile.kt:55)
at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invoke(performByIrFile.kt:41)
at org.jetbrains.kotlin.backend.common.phaser.NamedCompilerPhase.invoke(CompilerPhase.kt:96)
at org.jetbrains.kotlin.backend.common.phaser.CompositePhase.invoke(PhaseBuilders.kt:29)
at org.jetbrains.kotlin.backend.common.phaser.NamedCompilerPhase.invoke(CompilerPhase.kt:96)
at org.jetbrains.kotlin.backend.common.phaser.CompositePhase.invoke(PhaseBuilders.kt:29)
at org.jetbrains.kotlin.backend.common.phaser.NamedCompilerPhase.invoke(CompilerPhase.kt:96)
at org.jetbrains.kotlin.backend.common.phaser.CompilerPhaseKt.invokeToplevel(CompilerPhase.kt:43)
at org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory.doGenerateFilesInternal(JvmIrCodegenFactory.kt:191)
at org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory.generateModule(JvmIrCodegenFactory.kt:60)
at org.jetbrains.kotlin.codegen.KotlinCodegenFacade.compileCorrectFiles(KotlinCodegenFacade.java:35)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.generate(KotlinToJVMBytecodeCompiler.kt:321)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:113)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli$default(KotlinToJVMBytecodeCompiler.kt:56)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:169)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:52)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:92)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98)
at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:412)
at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:112)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally(IncrementalCompilerRunner.kt:358)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally$default(IncrementalCompilerRunner.kt:300)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl$rebuild(IncrementalCompilerRunner.kt:119)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl(IncrementalCompilerRunner.kt:170)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:81)
at org.jetbrains.kotlin.daemon.CompileServiceImplBase.execIncrementalCompiler(CompileServiceImpl.kt:607)
at org.jetbrains.kotlin.daemon.CompileServiceImplBase.access$execIncrementalCompiler(CompileServiceImpl.kt:96)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1658)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: Exception while generating code for:
FUN name:write$Self visibility:public modality:FINAL <> (self:net.folivo.trixnity.core.model.events.UnsignedData, output:kotlinx.serialization.encoding.CompositeEncoder, serialDesc:kotlinx.serialization.descriptors.SerialDescriptor) returnType:kotlin.Unit
annotations:
JvmStatic
VALUE_PARAMETER name:self index:0 type:net.folivo.trixnity.core.model.events.UnsignedData
VALUE_PARAMETER name:output index:1 type:kotlinx.serialization.encoding.CompositeEncoder
VALUE_PARAMETER name:serialDesc index:2 type:kotlinx.serialization.descriptors.SerialDescriptor
BLOCK_BODY
WHEN type=kotlin.Unit origin=null
BRANCH
if: WHEN type=kotlin.Boolean origin=null
BRANCH
if: CALL 'public open fun shouldEncodeElementDefault (descriptor: kotlinx.serialization.descriptors.SerialDescriptor, index: kotlin.Int): kotlin.Boolean declared in kotlinx.serialization.encoding.CompositeEncoder' type=kotlin.Boolean origin=null
$this: GET_VAR 'output: kotlinx.serialization.encoding.CompositeEncoder declared in net.folivo.trixnity.core.model.events.UnsignedData.write$Self' type=kotlinx.serialization.encoding.CompositeEncoder origin=null
descriptor: GET_VAR 'serialDesc: kotlinx.serialization.descriptors.SerialDescriptor declared in net.folivo.trixnity.core.model.events.UnsignedData.write$Self' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null
index: CONST Int type=kotlin.Int value=0
then: CONST Boolean type=kotlin.Boolean value=true
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
arg0: BLOCK type=@[Contextual] net.folivo.trixnity.core.model.events.Event<*>? origin=null
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:redactedBecause type:@[Contextual] net.folivo.trixnity.core.model.events.Event<*>? visibility:private [final]' type=@[Contextual] net.folivo.trixnity.core.model.events.Event<*>? origin=null
receiver: GET_VAR 'self: net.folivo.trixnity.core.model.events.UnsignedData declared in net.folivo.trixnity.core.model.events.UnsignedData.write$Self' type=net.folivo.trixnity.core.model.events.UnsignedData origin=null
arg1: CONST Null type=kotlin.Nothing? value=null
then: CALL 'public abstract fun encodeNullableSerializableElement <T> (descriptor: kotlinx.serialization.descriptors.SerialDescriptor, index: kotlin.Int, serializer: kotlinx.serialization.SerializationStrategy<T of kotlinx.serialization.encoding.CompositeEncoder.encodeNullableSerializableElement>, value: T of kotlinx.serialization.encoding.CompositeEncoder.encodeNullableSerializableElement?): kotlin.Unit declared in kotlinx.serialization.encoding.CompositeEncoder' type=kotlin.Unit origin=null
<T>: @[Contextual] net.folivo.trixnity.core.model.events.Event<*>?
$this: GET_VAR 'output: kotlinx.serialization.encoding.CompositeEncoder declared in net.folivo.trixnity.core.model.events.UnsignedData.write$Self' type=kotlinx.serialization.encoding.CompositeEncoder origin=null
descriptor: GET_VAR 'serialDesc: kotlinx.serialization.descriptors.SerialDescriptor declared in net.folivo.trixnity.core.model.events.UnsignedData.write$Self' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null
index: CONST Int type=kotlin.Int value=0
serializer: CONSTRUCTOR_CALL 'public constructor <init> (serializableClass: kotlin.reflect.KClass<T of kotlinx.serialization.ContextualSerializer>, fallbackSerializer: kotlinx.serialization.KSerializer<T of kotlinx.serialization.ContextualSerializer>?, typeArgumentsSerializers: kotlin.Array<kotlinx.serialization.KSerializer<*>>) [primary] declared in kotlinx.serialization.ContextualSerializer' type=kotlinx.serialization.ContextualSerializer<@[Contextual] net.folivo.trixnity.core.model.events.Event<*>?> origin=null
<class: T>: @[Contextual] net.folivo.trixnity.core.model.events.Event<*>?
serializableClass: CLASS_REFERENCE 'CLASS CLASS name:Event modality:SEALED visibility:public superTypes:[kotlin.Any]' type=kotlin.reflect.KClass<*>
fallbackSerializer: CALL 'public final fun <get-nullable> <T> (): kotlinx.serialization.KSerializer<T of kotlinx.serialization.builtins.BuiltinSerializersKt.<get-nullable>?> declared in kotlinx.serialization.builtins.BuiltinSerializersKt' type=kotlinx.serialization.KSerializer<@[Contextual] net.folivo.trixnity.core.model.events.Event<*>?> origin=null
<T>: @[Contextual] net.folivo.trixnity.core.model.events.Event<*>
$receiver: CALL 'public final fun serializer <T0> (typeSerial0: kotlinx.serialization.KSerializer<T0 of net.folivo.trixnity.core.model.events.Event.Companion.serializer>): kotlinx.serialization.KSerializer<net.folivo.trixnity.core.model.events.Event<T0 of net.folivo.trixnity.core.model.events.Event.Companion.serializer>> declared in net.folivo.trixnity.core.model.events.Event.Companion' type=kotlinx.serialization.KSerializer<net.folivo.trixnity.core.model.events.Event<T0 of net.folivo.trixnity.core.model.events.Event.Companion.serializer>> origin=null
<T0>: @[Contextual] net.folivo.trixnity.core.model.events.Event<*>?
$this: GET_FIELD 'FIELD FIELD_FOR_OBJECT_INSTANCE name:Companion type:net.folivo.trixnity.core.model.events.Event.Companion visibility:public [final,static]' type=net.folivo.trixnity.core.model.events.Event.Companion origin=null
typeArgumentsSerializers: BLOCK type=kotlin.Array<kotlinx.serialization.KSerializer<out @[Contextual] net.folivo.trixnity.core.model.events.Event<*>?>> origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp0 type:kotlin.Array<kotlinx.serialization.KSerializer<out @[Contextual] net.folivo.trixnity.core.model.events.Event<*>?>> [val]
CALL 'public final fun arrayOfNulls <T> (size: kotlin.Int): kotlin.Array<T of kotlin.arrayOfNulls?> declared in kotlin' type=kotlin.Array<kotlinx.serialization.KSerializer<out @[Contextual] net.folivo.trixnity.core.model.events.Event<*>?>> origin=null
<T>: kotlinx.serialization.KSerializer<out @[Contextual] net.folivo.trixnity.core.model.events.Event<*>?>
size: CONST Int type=kotlin.Int value=1
CALL 'public final fun set (index: kotlin.Int, value: T of kotlin.Array): kotlin.Unit [operator] declared in kotlin.Array' type=kotlin.Unit origin=null
$this: GET_VAR 'val tmp0: kotlin.Array<kotlinx.serialization.KSerializer<out @[Contextual] net.folivo.trixnity.core.model.events.Event<*>?>> [val] declared in net.folivo.trixnity.core.model.events.UnsignedData.write$Self' type=kotlin.Array<kotlinx.serialization.KSerializer<out @[Contextual] net.folivo.trixnity.core.model.events.Event<*>?>> origin=null
index: CONST Int type=kotlin.Int value=0
value: CONSTRUCTOR_CALL 'public constructor <init> (baseClass: kotlin.reflect.KClass<T of kotlinx.serialization.PolymorphicSerializer>) [primary] declared in kotlinx.serialization.PolymorphicSerializer' type=kotlinx.serialization.PolymorphicSerializer<net.folivo.trixnity.core.model.events.EventContent> origin=null
<class: T>: net.folivo.trixnity.core.model.events.EventContent
baseClass: CLASS_REFERENCE 'CLASS INTERFACE name:EventContent modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' type=kotlin.reflect.KClass<*>
GET_VAR 'val tmp0: kotlin.Array<kotlinx.serialization.KSerializer<out @[Contextual] net.folivo.trixnity.core.model.events.Event<*>?>> [val] declared in net.folivo.trixnity.core.model.events.UnsignedData.write$Self' type=kotlin.Array<kotlinx.serialization.KSerializer<out @[Contextual] net.folivo.trixnity.core.model.events.Event<*>?>> origin=null
value: BLOCK type=@[Contextual] net.folivo.trixnity.core.model.events.Event<*>? origin=null
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:redactedBecause type:@[Contextual] net.folivo.trixnity.core.model.events.Event<*>? visibility:private [final]' type=@[Contextual] net.folivo.trixnity.core.model.events.Event<*>? origin=null
receiver: GET_VAR 'self: net.folivo.trixnity.core.model.events.UnsignedData declared in net.folivo.trixnity.core.model.events.UnsignedData.write$Self' type=net.folivo.trixnity.core.model.events.UnsignedData origin=null
at org.jetbrains.kotlin.backend.jvm.codegen.FunctionCodegen.generate(FunctionCodegen.kt:50)
at org.jetbrains.kotlin.backend.jvm.codegen.FunctionCodegen.generate$default(FunctionCodegen.kt:43)
at org.jetbrains.kotlin.backend.jvm.codegen.ClassCodegen.generateMethodNode(ClassCodegen.kt:341)
at org.jetbrains.kotlin.backend.jvm.codegen.ClassCodegen.generateMethod(ClassCodegen.kt:358)
at org.jetbrains.kotlin.backend.jvm.codegen.ClassCodegen.generate(ClassCodegen.kt:130)
at org.jetbrains.kotlin.backend.jvm.JvmLowerKt$codegenPhase$1$1.lower(JvmLower.kt:304)
at org.jetbrains.kotlin.backend.common.phaser.FileLoweringPhaseAdapter.invoke(PhaseBuilders.kt:120)
at org.jetbrains.kotlin.backend.common.phaser.FileLoweringPhaseAdapter.invoke(PhaseBuilders.kt:116)
at org.jetbrains.kotlin.backend.common.phaser.NamedCompilerPhase.invoke(CompilerPhase.kt:96)
at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invokeSequential(performByIrFile.kt:65)
... 46 more
Caused by: java.lang.IllegalArgumentException: Null argument in ExpressionCodegen for parameter VALUE_PARAMETER name:typeSerial0 index:0 type:kotlinx.serialization.KSerializer<T0 of net.folivo.trixnity.core.model.events.Event.Companion.serializer>
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitCall(ExpressionCodegen.kt:478)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitCall(ExpressionCodegen.kt:134)
at org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl.accept(IrCallImpl.kt:47)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.gen(ExpressionCodegen.kt:217)
at org.jetbrains.kotlin.backend.jvm.codegen.IrCallGenerator$DefaultImpls.genValueAndPut(IrCallGenerator.kt:47)
at org.jetbrains.kotlin.backend.jvm.codegen.IrCallGenerator$DefaultCallGenerator.genValueAndPut(IrCallGenerator.kt:50)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitCall(ExpressionCodegen.kt:471)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitCall(ExpressionCodegen.kt:134)
at org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl.accept(IrCallImpl.kt:47)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.gen(ExpressionCodegen.kt:217)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.generateConstructorArguments(ExpressionCodegen.kt:605)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitConstructorCall(ExpressionCodegen.kt:593)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitConstructorCall(ExpressionCodegen.kt:134)
at org.jetbrains.kotlin.ir.expressions.impl.IrConstructorCallImpl.accept(IrConstructorCallImpl.kt:28)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.gen(ExpressionCodegen.kt:217)
at org.jetbrains.kotlin.backend.jvm.codegen.IrCallGenerator$DefaultImpls.genValueAndPut(IrCallGenerator.kt:47)
at org.jetbrains.kotlin.backend.jvm.codegen.IrCallGenerator$DefaultCallGenerator.genValueAndPut(IrCallGenerator.kt:50)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitCall(ExpressionCodegen.kt:479)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitCall(ExpressionCodegen.kt:134)
at org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl.accept(IrCallImpl.kt:47)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitWhen(ExpressionCodegen.kt:980)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitWhen(ExpressionCodegen.kt:134)
at org.jetbrains.kotlin.ir.expressions.IrWhen.accept(IrWhen.kt:29)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitStatementContainer(ExpressionCodegen.kt:435)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitBlockBody(ExpressionCodegen.kt:439)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitBlockBody(ExpressionCodegen.kt:134)
at org.jetbrains.kotlin.ir.expressions.IrBlockBody.accept(IrBody.kt:54)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.generate(ExpressionCodegen.kt:235)
at org.jetbrains.kotlin.backend.jvm.codegen.FunctionCodegen.doGenerate(FunctionCodegen.kt:122)
at org.jetbrains.kotlin.backend.jvm.codegen.FunctionCodegen.generate(FunctionCodegen.kt:48)
... 55 more
Can confirm @benkuly 's report. Have a similar exception on JVM while trying to upgrade to Kotlin 1.5.30.
...
Caused by: java.lang.IllegalArgumentException: Null argument in ExpressionCodegen for parameter VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:typeSerial0 index:0 type:kotlinx.serialization.KSerializer<T0 of dk.cachet.carp.common.application.devices.MasterDeviceDescriptor.Companion.serializer>
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitCall(ExpressionCodegen.kt:478)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitCall(ExpressionCodegen.kt:134)
at org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl.accept(IrCallImpl.kt:47)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.gen(ExpressionCodegen.kt:217)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.generateConstructorArguments(ExpressionCodegen.kt:605)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitConstructorCall(ExpressionCodegen.kt:593)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitConstructorCall(ExpressionCodegen.kt:134)
at org.jetbrains.kotlin.ir.expressions.impl.IrConstructorCallImpl.accept(IrConstructorCallImpl.kt:28)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.gen(ExpressionCodegen.kt:217)
at org.jetbrains.kotlin.backend.jvm.codegen.IrCallGenerator$DefaultImpls.genValueAndPut(IrCallGenerator.kt:47)
at org.jetbrains.kotlin.backend.jvm.codegen.IrCallGenerator$DefaultCallGenerator.genValueAndPut(IrCallGenerator.kt:50)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitCall(ExpressionCodegen.kt:479)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitCall(ExpressionCodegen.kt:134)
at org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl.accept(IrCallImpl.kt:47)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitStatementContainer(ExpressionCodegen.kt:435)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitBlockBody(ExpressionCodegen.kt:439)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitBlockBody(ExpressionCodegen.kt:134)
at org.jetbrains.kotlin.ir.expressions.IrBlockBody.accept(IrBody.kt:54)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.generate(ExpressionCodegen.kt:235)
at org.jetbrains.kotlin.backend.jvm.codegen.FunctionCodegen.doGenerate(FunctionCodegen.kt:122)
at org.jetbrains.kotlin.backend.jvm.codegen.FunctionCodegen.generate(FunctionCodegen.kt:48)
... 55 more
But, I don't use @Contextual
. So maybe I should post this as a new bug report?
I'm not using @Contextual
either. I think this has to do with generics. @benkuly just happens to be using both.
With Kotlin 1.5.30 this does also affect the jvm target with the following exception. I also updated the example branch linked above.
Actually it was another issue, that was fixed in 1.5.31. But the e: java.lang.IllegalStateException: Not found Idx for public
issue is still present for JS IR and Native IR.
As mentioned above: If I would know, where to start, I could try to fix the issue.
Writing a multiplatform library, where JVM is the only target that works, is very frustrating :(
This issue seems to be fixed with kotlin 1.6.0. Thank you!
@benkuly Thank you for reopening. Although the bug seems similar, I thought it was worth reporting separately. Feel free to close this again.
Describe the bug I use
@Contextual
at many places in my multiplatform library. It works fine and all my unit tests are working with jvm und js(LEGACY), but not with js(IR) and native targets. I get the following stacktrace when building the project:To Reproduce Here is a minimal example from my code base.
Expected behavior
@Contextual
should work with IR compiler as it does without.Environment