https://kotlinlang.org logo
Title
c

czyzby

12/17/2017, 4:35 PM
I'm still getting an internal compiler error on inline method after updating to Kotlin 1.2.10. Is this a known issue?
org.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM) Internal error: Couldn't inline method call 'addTooltip' into
@org.junit.Test public final fun `should add Tooltip with init block`(): kotlin.Unit defined in ktx.scene2d.TooltipFactoriesTest

(...)

Cause: addTooltip$default (Lcom/badlogic/gdx/scenes/scene2d/Actor;Ljava/lang/String;Lcom/badlogic/gdx/scenes/scene2d/ui/Skin;Lcom/badlogic/gdx/scenes/scene2d/ui/TooltipManager;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lcom/badlogic/gdx/scenes/scene2d/ui/Tooltip;:
  @Lorg/jetbrains/annotations/NotNull;() // invisible

(...)

The root cause was thrown at: SMAPAndMethodNode.kt:38
	at org.jetbrains.kotlin.codegen.inline.InlineCodegen.throwCompilationException(InlineCodegen.kt:132)
:kotlin: 1
l

louiscad

12/17/2017, 8:31 PM
@czyzby Are you using inline lambdas default values feature?
c

czyzby

12/17/2017, 8:49 PM
Yes. Without the
inline
keyword, the function works as expected.
l

louiscad

12/17/2017, 9:19 PM
So I already reported a similar error. Will make it public and will share you the link later
Please, add a comment for your use case in the :youtrack: issue
i

ilya.gorbunov

12/18/2017, 3:33 AM
@czyzby What was the version of Kotlin before you have upgraded to 1.2.10?
c

czyzby

12/18/2017, 7:15 AM
It did not work in 1.2.0 as well. Adding default funtional parameters to an inline method broke it, I temporarily converted it to a non-inlined function. Without the default functional parameter, it worked as expected.
@ilya.gorbunov
l

louiscad

12/18/2017, 8:37 AM
@ilya.gorbunov In my similar case, I got the issue on both 1.20 and 1.2.10