Since updating to 2.2, and bumping language versio...
# compiler
a
Since updating to 2.2, and bumping language version to 2.2, we've started seeing this error quite often on CI:
Copy code
Caused by: java.lang.IllegalStateException: couldn't find inline method Lkotlin/time/Duration$Companion;.getMilliseconds-5sfh64U(I)J
It always fails on some standard usage of the
Duration
extensions. Is there any way to narrow down this issue?
Copy code
Caused by: java.lang.IllegalStateException: couldn't find inline method Lkotlin/time/Duration$Companion;.getMilliseconds-5sfh64U(I)J
	at org.jetbrains.kotlin.codegen.inline.SourceCompilerForInlineKt.getMethodNode(SourceCompilerForInline.kt:129)
	at org.jetbrains.kotlin.codegen.inline.SourceCompilerForInlineKt.loadCompiledInlineFunction$lambda$2(SourceCompilerForInline.kt:98)
	at org.jetbrains.kotlin.codegen.inline.InlineCache.computeMethodBytes(InlineCache.kt:90)
	at org.jetbrains.kotlin.codegen.inline.SourceCompilerForInlineKt.loadCompiledInlineFunction(SourceCompilerForInline.kt:93)
	at org.jetbrains.kotlin.backend.jvm.codegen.IrSourceCompilerForInline.compileInlineFunction(IrSourceCompilerForInline.kt:96)
	at org.jetbrains.kotlin.backend.jvm.codegen.IrInlineCodegen.canInlineArgumentsInPlace(IrInlineCodegen.kt:256)
	at org.jetbrains.kotlin.backend.jvm.codegen.IrInlineCodegen.<init>(IrInlineCodegen.kt:50)
	at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.getOrCreateCallGenerator(ExpressionCodegen.kt:1568)
	at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitCall(ExpressionCodegen.kt:554)
	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.codegen.ExpressionCodegen.visitFieldAccess(ExpressionCodegen.kt:824)
	at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitFieldAccess(ExpressionCodegen.kt:135)
	at org.jetbrains.kotlin.ir.visitors.IrVisitor.visitSetField(IrVisitor.kt:215)
	at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitSetField(ExpressionCodegen.kt:858)
	at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitSetField(ExpressionCodegen.kt:135)
	at org.jetbrains.kotlin.ir.expressions.IrSetField.accept(IrSetField.kt:21)
	at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitStatementContainer(ExpressionCodegen.kt:527)
	at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitContainerExpression(ExpressionCodegen.kt:541)
	at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitContainerExpression(ExpressionCodegen.kt:135)
	at org.jetbrains.kotlin.ir.visitors.IrVisitor.visitBlock(IrVisitor.kt:122)
	at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitBlock(ExpressionCodegen.kt:413)
	at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitBlock(ExpressionCodegen.kt:135)
	at org.jetbrains.kotlin.ir.expressions.IrBlock.accept(IrBlock.kt:18)
	at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitStatementContainer(ExpressionCodegen.kt:527)
	at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitBlockBody(ExpressionCodegen.kt:532)
	at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.visitBlockBody(ExpressionCodegen.kt:135)
	at org.jetbrains.kotlin.ir.expressions.IrBlockBody.accept(IrBlockBody.kt:20)
	at org.jetbrains.kotlin.backend.jvm.codegen.ExpressionCodegen.generate(ExpressionCodegen.kt:233)
	at org.jetbrains.kotlin.backend.jvm.codegen.FunctionCodegen.doGenerate(FunctionCodegen.kt:126)
	at org.jetbrains.kotlin.backend.jvm.codegen.FunctionCodegen.generate(FunctionCodegen.kt:47)
	... 45 more,
b
might this have something to do with the migration of some kotlinx.datetime functionality to stdlib?
we had to rebuild an republish everything when upgrading to 2.2, as we were using kotlinx.datetime in essentially all our projects
a
I don't think so,
Duration
has been in stdlib for quite a while now. Also, I've wiped the CI cache since the bump and it keeps coming back
b
from my far away perspective that smells like so messed-up classpath; different versions of the stdlib in different transitive dependencies maybe?
a
I did consider that, and it is possible, though I feel like it should happen every time then?
b
i have to agree. then i got nothing. sorry!
a
It also happens when we compile our modules, which all have an explicit dependency on the stdlib
Thanks though!
v
Do you have a reproducer for the issue?
a
No, but it happens quite often on CI
What’s strange is that it only happens when there is a build cache entry. I assumed it was due to IC but disabling that did not make a difference
It just happened again. This is what it was compiling:
Copy code
LaunchedEffect(Unit) {
     delay(1.seconds)
     isRefreshing = false
 }
It exclusively seems to happens with the duration extensions