diff --git a/.idea/runConfigurations/Codegen_Tests_with_JVM_target_9_on_JDK_9_.xml b/.idea/runConfigurations/Codegen_Tests_with_JVM_target_9_on_JDK_9_.xml new file mode 100644 index 00000000000..39de620113f --- /dev/null +++ b/.idea/runConfigurations/Codegen_Tests_with_JVM_target_9_on_JDK_9_.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/config/JvmTarget.kt b/compiler/frontend.java/src/org/jetbrains/kotlin/config/JvmTarget.kt index 5591772d556..7c6ed945f01 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/config/JvmTarget.kt +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/config/JvmTarget.kt @@ -23,11 +23,13 @@ enum class JvmTarget(override val description: String) : TargetPlatformVersion { JVM_1_8("1.8"), ; - val bytecodeVersion: Int - get() = when(this) { + val bytecodeVersion: Int by lazy { + when (this) { JVM_1_6 -> Opcodes.V1_6 - JVM_1_8 -> Opcodes.V1_8 + JVM_1_8 -> + if (java.lang.Boolean.valueOf(System.getProperty("kotlin.test.substitute.bytecode.1.8.to.1.9"))) Opcodes.V1_9 else Opcodes.V1_8 } + } companion object { @JvmField @@ -40,7 +42,7 @@ enum class JvmTarget(override val description: String) : TargetPlatformVersion { val platformDescription = values().find { it.bytecodeVersion == bytecodeVersion }?.description ?: when (bytecodeVersion) { Opcodes.V1_7 -> "1.7" - Opcodes.V1_8 + 1 -> "1.9" + Opcodes.V1_9 -> "1.9" else -> null }