w

    Wolf Logan

    2 years ago
    I'm running into an internal compiler error while trying to migrate my project to Kotlin 1.4. I have a Kotlin Multiplatform project (Gradle w/Kotlin dialect) building for two targets (JS and JVM); the JVM target uses Spring Boot 2.2.6. With the project configured to use the 1.3.72 plugin, everything builds fine. Moving to the 1.4.0 plugin (and updating Kotlin library references to 1.4.0) causes the build to fail with the error below:
    FAILURE: Build failed with an exception.
    * What went wrong:
    Execution failed for task ':compileKotlinJvm'.
    > Internal compiler error. See log for more details
     . . .
    /xxx/xxx/xxx.kt:57
      @PutMapping("/{userId}", consumes = [MediaType.APPLICATION_JSON_VALUE])
                                          ^
    e: org.jetbrains.kotlin.util.KotlinFrontEndException: Exception while analyzing expression at (57,39) in /xxx/xxx/xxx.kt
    	at org.jetbrains.kotlin.types.expressions.ExpressionTypingVisitorDispatcher.logOrThrowException(ExpressionTypingVisitorDispatcher.java:253)
     . . .
    Caused by: java.lang.NoSuchMethodError: kotlin.sequences.SequencesKt.flatMapIterable(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
    	at org.jetbrains.kotlin.resolve.calls.components.CollectionTypeVariableUsagesInfo.getDependentTypeParameters(ResolutionParts.kt:364)
    Robert Jaros

    Robert Jaros

    2 years ago
    try adding
    extra["kotlin.version"] = "1.4.0"
    to your
    build.gradle.kts
    .
    at least it lets me run spring boot 2.3.3 app with 1.4.0
    w

    Wolf Logan

    2 years ago
    Magic! Thanks very much. Is there documentation anywhere regarding how that value is used?
    w

    Wolf Logan

    2 years ago
    perfect, thanks!