UnsupportedOperationException: IrValueParameterImpl upgrading to Kotlin 1.3.30
See original GitHub issueAfter upgrading from Kotlin 1.3.21 (gradle 4.10.2) to 1.3.30 (gradle 5.1.1), we get this exception building (at one of the link stages) for iOS sim (iOSX64):
> Task :linkTestDebugExecutableIosSim
e: Compilation failed: org.jetbrains.kotlin.ir.declarations.impl.IrValueParameterImpl@37a28e2c
* Source files: <redacted>
* Compiler version info: Konan: 1.2 / Kotlin: 1.3.30
* Output kind: PROGRAM
e: java.lang.UnsupportedOperationException: org.jetbrains.kotlin.ir.declarations.impl.IrValueParameterImpl@37a28e2c
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor$TopLevelCodeContext.unsupported(IrToBitcode.kt:242)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor$TopLevelCodeContext.genGetValue(IrToBitcode.kt:258)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor$TopLevelCodeContext.genGetValue(IrToBitcode.kt:241)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor$InnerScope.genGetValue(IrToBitcode.kt)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor$InnerScope.genGetValue(IrToBitcode.kt)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor$InnerScope.genGetValue(IrToBitcode.kt)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor$InnerScope.genGetValue(IrToBitcode.kt)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor$InnerScope.genGetValue(IrToBitcode.kt)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor$InnerScope.genGetValue(IrToBitcode.kt)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor$ParameterScope.genGetValue(IrToBitcode.kt:577)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor$InnerScope.genGetValue(IrToBitcode.kt)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor$VariableScope.genGetValue(IrToBitcode.kt:545)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor$InnerScope.genGetValue(IrToBitcode.kt)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor$VariableScope.genGetValue(IrToBitcode.kt:545)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.evaluateGetValue(IrToBitcode.kt:1164)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.evaluateExpression(IrToBitcode.kt:762)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.evaluateExplicitArgs(IrToBitcode.kt:1890)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.evaluateCall(IrToBitcode.kt:1741)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.evaluateExpression(IrToBitcode.kt:757)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.evaluateExplicitArgs(IrToBitcode.kt:1890)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.evaluateCall(IrToBitcode.kt:1741)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.evaluateExpression(IrToBitcode.kt:757)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.evaluateExplicitArgs(IrToBitcode.kt:1890)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.evaluateCall(IrToBitcode.kt:1741)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.evaluateExpression(IrToBitcode.kt:757)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.generateVariable(IrToBitcode.kt:1216)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.generateStatement(IrToBitcode.kt:795)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.evaluateContainerExpression(IrToBitcode.kt:1715)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.evaluateExpression(IrToBitcode.kt:772)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.evaluateExplicitArgs(IrToBitcode.kt:1890)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.evaluateCall(IrToBitcode.kt:1741)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.evaluateExpression(IrToBitcode.kt:757)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.evaluateExplicitArgs(IrToBitcode.kt:1890)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.evaluateCall(IrToBitcode.kt:1741)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.evaluateExpression(IrToBitcode.kt:757)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.evaluateExplicitArgs(IrToBitcode.kt:1890)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.evaluateCall(IrToBitcode.kt:1741)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.evaluateExpression(IrToBitcode.kt:757)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.generateWhenCase(IrToBitcode.kt:1092)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.evaluateWhen(IrToBitcode.kt:1073)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.evaluateExpression(IrToBitcode.kt:768)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.generateWhenCase(IrToBitcode.kt:1092)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.evaluateWhen(IrToBitcode.kt:1073)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.evaluateExpression(IrToBitcode.kt:768)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.generateStatement(IrToBitcode.kt:794)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.visitFunction(IrToBitcode.kt:672)
at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitSimpleFunction(IrElementVisitorVoid.kt:52)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.visitSimpleFunction(IrToBitcode.kt:201)
at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitSimpleFunction(IrElementVisitorVoid.kt:53)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.visitSimpleFunction(IrToBitcode.kt:201)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.visitSimpleFunction(IrToBitcode.kt:201)
at org.jetbrains.kotlin.ir.declarations.impl.IrFunctionImpl.accept(IrFunctionImpl.kt:92)
at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoidKt.acceptVoid(IrElementVisitorVoid.kt:258)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.visitClass(IrToBitcode.kt:712)
at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitClass(IrElementVisitorVoid.kt:44)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.visitClass(IrToBitcode.kt:201)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.visitClass(IrToBitcode.kt:201)
at org.jetbrains.kotlin.ir.declarations.impl.IrClassImpl.accept(IrClassImpl.kt:108)
at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoidKt.acceptVoid(IrElementVisitorVoid.kt:258)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.visitClass(IrToBitcode.kt:712)
at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitClass(IrElementVisitorVoid.kt:44)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.visitClass(IrToBitcode.kt:201)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.visitClass(IrToBitcode.kt:201)
at org.jetbrains.kotlin.ir.declarations.impl.IrClassImpl.accept(IrClassImpl.kt:108)
at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoidKt.acceptVoid(IrElementVisitorVoid.kt:258)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.visitClass(IrToBitcode.kt:712)
at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitClass(IrElementVisitorVoid.kt:44)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.visitClass(IrToBitcode.kt:201)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.visitClass(IrToBitcode.kt:201)
at org.jetbrains.kotlin.ir.declarations.impl.IrClassImpl.accept(IrClassImpl.kt:108)
at org.jetbrains.kotlin.ir.declarations.impl.IrFileImpl.acceptChildren(IrFileImpl.kt:82)
at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoidKt.acceptChildrenVoid(IrElementVisitorVoid.kt:262)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.visitFile(IrToBitcode.kt:457)
at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitFile(IrElementVisitorVoid.kt:38)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.visitFile(IrToBitcode.kt:201)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.visitFile(IrToBitcode.kt:201)
at org.jetbrains.kotlin.ir.declarations.impl.IrFileImpl.accept(IrFileImpl.kt:79)
at org.jetbrains.kotlin.ir.declarations.impl.IrModuleFragmentImpl.acceptChildren(IrModuleFragmentImpl.kt:45)
at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoidKt.acceptChildrenVoid(IrElementVisitorVoid.kt:262)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.visitModuleFragment(IrToBitcode.kt:314)
at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitModuleFragment(IrElementVisitorVoid.kt:28)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.visitModuleFragment(IrToBitcode.kt:201)
at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.visitModuleFragment(IrToBitcode.kt:201)
at org.jetbrains.kotlin.ir.declarations.impl.IrModuleFragmentImpl.accept(IrModuleFragmentImpl.kt:42)
at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoidKt.acceptVoid(IrElementVisitorVoid.kt:258)
at org.jetbrains.kotlin.backend.konan.llvm.BitcodePhasesKt$codegenPhase$1.invoke(BitcodePhases.kt:134)
at org.jetbrains.kotlin.backend.konan.llvm.BitcodePhasesKt$codegenPhase$1.invoke(BitcodePhases.kt)
at org.jetbrains.kotlin.backend.konan.KonanLoweringPhasesKt$makeKonanModuleOpPhase$1.invoke(KonanLoweringPhases.kt:55)
at org.jetbrains.kotlin.backend.konan.KonanLoweringPhasesKt$makeKonanModuleOpPhase$1.invoke(KonanLoweringPhases.kt:53)
at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper$runBody$1.invoke(CompilerPhase.kt:91)
at org.jetbrains.kotlin.backend.common.phaser.CompilerPhaseKt.downlevel(CompilerPhase.kt:18)
at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.runBody(CompilerPhase.kt:90)
at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.invoke(CompilerPhase.kt:73)
at org.jetbrains.kotlin.backend.common.phaser.PhaseBuildersKt$then$1.invoke(PhaseBuilders.kt:15)
at org.jetbrains.kotlin.backend.common.phaser.PhaseBuildersKt$then$1.invoke(PhaseBuilders.kt:14)
at org.jetbrains.kotlin.backend.common.phaser.PhaseBuildersKt$then$1.invoke(PhaseBuilders.kt:14)
at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper$runBody$1.invoke(CompilerPhase.kt:91)
at org.jetbrains.kotlin.backend.common.phaser.CompilerPhaseKt.downlevel(CompilerPhase.kt:18)
at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.runBody(CompilerPhase.kt:90)
at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.invoke(CompilerPhase.kt:73)
at org.jetbrains.kotlin.backend.common.phaser.PhaseBuildersKt$then$1.invoke(PhaseBuilders.kt:15)
at org.jetbrains.kotlin.backend.common.phaser.PhaseBuildersKt$then$1.invoke(PhaseBuilders.kt:14)
at org.jetbrains.kotlin.backend.common.phaser.PhaseBuildersKt$then$1.invoke(PhaseBuilders.kt:14)
at org.jetbrains.kotlin.backend.common.phaser.PhaseBuildersKt$then$1.invoke(PhaseBuilders.kt:14)
at org.jetbrains.kotlin.backend.common.phaser.PhaseBuildersKt$then$1.invoke(PhaseBuilders.kt:14)
at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper$runBody$1.invoke(CompilerPhase.kt:91)
at org.jetbrains.kotlin.backend.common.phaser.CompilerPhaseKt.downlevel(CompilerPhase.kt:18)
at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.runBody(CompilerPhase.kt:90)
at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.invoke(CompilerPhase.kt:73)
at org.jetbrains.kotlin.backend.common.phaser.PhaseBuildersKt$then$1.invoke(PhaseBuilders.kt:15)
at org.jetbrains.kotlin.backend.common.phaser.PhaseBuildersKt$then$1.invoke(PhaseBuilders.kt:14)
at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper$runBody$1.invoke(CompilerPhase.kt:91)
at org.jetbrains.kotlin.backend.common.phaser.CompilerPhaseKt.downlevel(CompilerPhase.kt:18)
at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.runBody(CompilerPhase.kt:90)
at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedPhaseWrapper.invoke(CompilerPhase.kt:73)
at org.jetbrains.kotlin.backend.common.phaser.CompilerPhaseKt.invokeToplevel(CompilerPhase.kt:33)
at org.jetbrains.kotlin.backend.konan.KonanDriverKt.runTopLevelPhases(KonanDriver.kt:30)
at org.jetbrains.kotlin.cli.bc.K2Native.doExecute(K2Native.kt:78)
at org.jetbrains.kotlin.cli.bc.K2Native.doExecute(K2Native.kt:35)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:84)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:42)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:103)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:81)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:49)
at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMainNoExit(CLITool.kt:214)
at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMain(CLITool.kt:206)
at org.jetbrains.kotlin.cli.bc.K2Native$Companion$main$1.invoke(K2Native.kt:217)
at org.jetbrains.kotlin.cli.bc.K2Native$Companion$main$1.invoke(K2Native.kt:208)
at org.jetbrains.kotlin.konan.util.UtilKt.profileIf(Util.kt:39)
at org.jetbrains.kotlin.konan.util.UtilKt.profile(Util.kt:33)
at org.jetbrains.kotlin.cli.bc.K2Native$Companion.main(K2Native.kt:210)
at org.jetbrains.kotlin.cli.bc.K2NativeKt.main(K2Native.kt:296)
at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:16)
> Task :linkTestDebugExecutableIosSim FAILED
I came up with a minimal repro project (run the linkTestDebugExecutableIos
task). It has something to do with creating a subclass in commonTest of a generic abstract class (or maybe even just implementing an interface) declared in commonMain, where that subclass is @Serializable
. Marking the subclass’s val
as @Transient
fixes the crash (and happened to be correct behavior-wise in my case).
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Update to Kotlin 1.3.30 breaks build with Dagger 2.21
This bug was already reported by someone on GitHub and on YouTrack. This should be fixed once Kotlin version 1.3.31 gets released. Update: ......
Read more >Kotlin releases
We ship different types of releases: Feature releases (1.x) that bring major changes in the language. Incremental releases (1.x.y) that are shipped between ......
Read more >Compatibility guide for Kotlin 1.3
While most of the language changes were already announced through other channels, like update changelogs or compiler warnings, this document ...
Read more >Compatibility guide for Kotlin 1.7
While most of the language changes were already announced through other channels, like update changelogs or compiler warnings, this document ...
Read more >Compatibility guide for Kotlin 1.4
While most of the language changes were already announced through other channels, like update changelogs or compiler warnings, this document ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Getting the same issue and there is no any indication where it comes from. Just an exception:
java.lang.UnsupportedOperationException: org.jetbrains.kotlin.ir.declarations.impl.IrValueParameterImpl@17f0cf7
It seems the same issue calculate property:
Changing to this helped to resolve the issue:
Same issue for me on 1.3.31 compiling for iOS:
val reasons: List<Reason>? = entryReasons?.reasons
causes the same error in the compiler. Changing to:
val reasons: List<Reason>? get() = entryReasons?.reasons
fixes it. Thank you.