dhkim
01/24/2017, 4:55 AMorangy
dhkim
01/24/2017, 6:34 AMdhkim
01/24/2017, 6:35 AMcompile
dependency on the annotation processor to make it work under 1.0.6
. That was not the case for my current project. Maybe I'm missing something.dhkim
01/24/2017, 6:36 AMdhkim
01/24/2017, 6:37 AMsdeleuze
01/24/2017, 7:53 AMsdeleuze
01/24/2017, 7:54 AMmax.kammerer
01/24/2017, 9:42 AMsdeleuze
01/24/2017, 9:52 AMsdeleuze
01/24/2017, 12:05 PMsdeleuze
01/24/2017, 12:05 PMcompileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
sdeleuze
01/24/2017, 12:06 PMsdeleuze
01/24/2017, 12:06 PM:spring-context:compileTestKotlin
e: org.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM) Internal error: Couldn't inline method call 'registerBean' into
@org.junit.Test public final fun registerBeanWithSupplier(): kotlin.Unit defined in org.springframework.context.support.GenericApplicationContextExtensionsTests[SimpleFunctionDescriptorImpl@37df56f]
@Test
fun registerBeanWithSupplier() {
val context = GenericApplicationContext()
context.registerBean { BeanA() }
context.refresh()
assertNotNull(context.getBean(BeanA::class))
}
Cause: Not generated
Cause: Cannot inline bytecode of class org/springframework/context/support/GenericApplicationContextExtensionsKt which has version 52. This compiler can only inline Java 1.6 bytecode (version 50)
File being compiled and position: (28,11) in /Users/seb/Workspace/spring-framework/spring-context/src/test/kotlin/org/springframework/context/support/GenericApplicationContextExtensionsTests.kt
PsiElement: registerBean { BeanA() }
The root cause was thrown at: InlineCodegenUtil.java:151
at org.jetbrains.kotlin.codegen.inline.InlineCodegen.throwCompilationException(InlineCodegen.java:203)
at org.jetbrains.kotlin.codegen.inline.InlineCodegen.genCallInner(InlineCodegen.java:189)
at org.jetbrains.kotlin.codegen.CallGenerator.genCall(CallGenerator.kt:104)
at org.jetbrains.kotlin.codegen.ExpressionCodegen.invokeMethodWithArguments(ExpressionCodegen.java:2900)
at org.jetbrains.kotlin.codegen.ExpressionCodegen.invokeMethodWithArguments(ExpressionCodegen.java:2845)
sdeleuze
01/24/2017, 12:07 PMsdeleuze
01/24/2017, 12:07 PMsdeleuze
01/24/2017, 12:07 PMsdeleuze
01/24/2017, 12:08 PMsdeleuze
01/24/2017, 12:09 PMsdeleuze
01/24/2017, 12:10 PMsdeleuze
01/24/2017, 12:10 PMsdeleuze
01/24/2017, 12:10 PMudalov
udalov
-Dkotlin.skip.bytecode.version.check=true
to the process where the compiler is being run to skip this check, but this obviously may lead to VerifyError etcmax.kammerer
01/24/2017, 12:29 PMsdeleuze
01/24/2017, 12:39 PM./gradlew clean compileTestJava
or ./gradlew clean compileTestKotlin
sdeleuze
01/24/2017, 12:40 PMsdeleuze
01/24/2017, 1:02 PMGenericApplicationContext.class
and GenericApplicationContextExtensionsKt.class
have bytecode version 52 (Java 8)ilya.gorbunov
01/24/2017, 1:08 PMjvmTarget
also in compileTestKotlin
task.sdeleuze
01/24/2017, 1:08 PM