I first noticed this last Friday, when I installed IntelliJ 2017.2 Public Preview, which contains Kotlin 1.1.3-85-eap… And unfortunately I didn’t realise then, how close to release this version was, and had reported only one via the IDE exception reporting mechanism.
The Kotlin compiler 1.1.3 gives me 2 different internal compiler errors on the code of my project, at least when building using the IDE-native plugin compiler.
One of the exceptions points to a specific line of code which has so far been legal Kotlin code in all versions of Kotlin 1.0 and 1.1 that I’ve used on this project:
@Entity
class AuthenticationConfiguration(
tokenExpiresIn: Long
.... ) {
....
@Column
var tokenExpiryDate: ZonedDateTime
init {
tokenExpiryDate = ZonedDateTime.now() + Duration.ofSeconds(tokenExpiresIn - 10L)
}
....
}
The problem is with the line in the init {} block; I’ve removed the rest of the class as it didn’t seem relevant to the context.
The exception message is:
Error:Kotlin: [Internal Error] org.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM) Internal error: Don't know how to generate outer expression for class AuthenticationConfiguration
Cause: Don't know how to generate outer expression for class AuthenticationConfiguration
File being compiled and position: (43,68) in D:/Dev/l1nda/gig-marketplace/temper-bridge/src/main/kotlin/nl/l1nda/jobmp/integrations/temper/model/AuthenticationConfiguration.kt
PsiElement: tokenExpiresIn
The root cause was thrown at: CodegenContext.java:218
The second internal compiler error doesn’t have a line number attached but is a ClassCastException.
I have attached the full stacktraces of both excpetions.
Since these errors are blocking for the project and the IDE plugin has already been updated I wonder if there’s a way to downgrade to the Kotlin 1.1.2 plugin version until both these issues have been resolved?
–Tim
kotlin-1.1.3-ice-code-generation-exception.txt.7z (2.0 KB)
kotlin-1.1.3-ice-classcast-exception.txt.7z (1.5 KB)