chrisjenx
03/25/2025, 5:33 PMpropertyIndices
I.e. should generate:
data class User(
val name: String
) {
// basically generate this:
companion object {
val propertyIndices: Map<String, Int>
get() = mapOf("name" to 0)
}
}
what stupid thing am I missing?chrisjenx
03/25/2025, 5:35 PMZac Sweers
03/25/2025, 6:09 PMchrisjenx
03/25/2025, 6:30 PMe: org.jetbrains.kotlin.backend.common.BackendException: Backend Internal error: Exception during IR lowering
File being compiled: /var/folders/11/343178bs5fgdz44s8lnn3l9r0000gn/T/junit4390338892868527185/compilationDir/sources/simple.kt
The root cause java.lang.RuntimeException was thrown at: org.jetbrains.kotlin.backend.jvm.codegen.FunctionCodegen.generate(FunctionCodegen.kt:48)
at org.jetbrains.kotlin.backend.common.CodegenUtil.reportBackendException(CodegenUtil.kt:107)
at org.jetbrains.kotlin.backend.common.CodegenUtil.reportBackendException$default(CodegenUtil.kt:90)
at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invokeSequential(performByIrFile.kt:54)
at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invoke(performByIrFile.kt:41)
at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invoke(performByIrFile.kt:27)
at org.jetbrains.kotlin.config.phaser.CompilerPhaseKt.invokeToplevel(CompilerPhase.kt:62)
at org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory.invokeCodegen(JvmIrCodegenFactory.kt:371)
Caused by: java.lang.NullPointerException
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitCall(ExpressionCodegen.kt:567)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitCall(ExpressionCodegen.kt:135)
at org.jetbrains.kotlin.ir.expressions.IrCall.accept(IrCall.kt:24)
at org.jetbrains.kotlin.backend.jvm.intrinsics.ArraySet.invoke(ArraySet.kt:32)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitCall(ExpressionCodegen.kt:541)
at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitCall(ExpressionCodegen.kt:135)
at org.jetbrains.kotlin.ir.expressions.IrCall.accept(IrCall.kt:24)
chrisjenx
03/25/2025, 6:32 PMchrisjenx
03/25/2025, 6:56 PMmapOf()
no paris, and it compiles, so I must be making my "name" to 0
pairs wrongchrisjenx
03/25/2025, 7:16 PMZac Sweers
03/25/2025, 7:16 PMZac Sweers
03/25/2025, 7:17 PMZac Sweers
03/25/2025, 7:17 PMchrisjenx
03/25/2025, 7:17 PMPavel Kunyavskiy [JB]
03/25/2025, 7:56 PMchrisjenx
03/25/2025, 7:57 PMZac Sweers
03/25/2025, 7:58 PMPavel Kunyavskiy [JB]
03/25/2025, 8:19 PM-Xphases-to-dump-before=ExternalPackageParentPatcherLowering
(this is first phase, but it work with any other, can be different for non-jvm) compiler flag.
This would print to stdout. With -Xdump-directory
flag you can dump it to files instead.shikasd
03/26/2025, 2:14 AMdmitriy.novozhilov
03/26/2025, 7:19 AM// FIR_DUMP
and // DUMP_IR
directives