diff --git a/compiler/config.jvm/src/org/jetbrains/kotlin/config/JvmTarget.kt b/compiler/config.jvm/src/org/jetbrains/kotlin/config/JvmTarget.kt index 7ce8378b4e2..b2e1e27fddd 100644 --- a/compiler/config.jvm/src/org/jetbrains/kotlin/config/JvmTarget.kt +++ b/compiler/config.jvm/src/org/jetbrains/kotlin/config/JvmTarget.kt @@ -35,6 +35,7 @@ enum class JvmTarget( JVM_16("16", Opcodes.V16), JVM_17("17", Opcodes.V16 + 1), JVM_18("18", Opcodes.V16 + 2), + JVM_19("19", Opcodes.V16 + 3), ; override fun toString() = description @@ -60,7 +61,7 @@ enum class JvmTarget( values().asList() - JVM_1_6 const val SUPPORTED_VERSIONS_DESCRIPTION = - "1.8, 9, 10, ..., 18" + "1.8, 9, 10, ..., 19" init { check(SUPPORTED_VERSIONS_DESCRIPTION == "1.8, 9, 10, ..., ${values().last().description}") { diff --git a/compiler/testData/cli/jvm/extraHelp.out b/compiler/testData/cli/jvm/extraHelp.out index 3aefb712fee..52de3fd3384 100644 --- a/compiler/testData/cli/jvm/extraHelp.out +++ b/compiler/testData/cli/jvm/extraHelp.out @@ -43,7 +43,7 @@ where advanced options include: -Xjava-source-roots= Paths to directories with Java source files -Xjavac-arguments= Java compiler arguments -Xjdk-release= Compile against the specified JDK API version, similarly to javac's `-release`. Requires JDK 9 or newer. - Supported versions depend on the used JDK; for JDK 17+ supported versions are 1.8, 9, 10, ..., 18. + Supported versions depend on the used JDK; for JDK 17+ supported versions are 1.8, 9, 10, ..., 19. Also sets `-jvm-target` value equal to the selected JDK version -Xjspecify-annotations=ignore|strict|warn Specify behavior for jspecify annotations. diff --git a/compiler/testData/cli/jvm/help.out b/compiler/testData/cli/jvm/help.out index 7f8e024961a..9386f288b58 100644 --- a/compiler/testData/cli/jvm/help.out +++ b/compiler/testData/cli/jvm/help.out @@ -6,7 +6,7 @@ where possible options include: -include-runtime Include Kotlin runtime into the resulting JAR -java-parameters Generate metadata for Java 1.8 reflection on method parameters -jdk-home Include a custom JDK from the specified location into the classpath instead of the default JAVA_HOME - -jvm-target Target version of the generated JVM bytecode (1.8, 9, 10, ..., 18), default is 1.8 + -jvm-target Target version of the generated JVM bytecode (1.8, 9, 10, ..., 19), default is 1.8 -module-name Name of the generated .kotlin_module file -no-jdk Don't automatically include the Java runtime into the classpath -no-reflect Don't automatically include Kotlin reflection into the classpath diff --git a/compiler/testData/cli/jvm/wrongJvmTargetVersion.out b/compiler/testData/cli/jvm/wrongJvmTargetVersion.out index f3322bb585e..4573bb67f66 100644 --- a/compiler/testData/cli/jvm/wrongJvmTargetVersion.out +++ b/compiler/testData/cli/jvm/wrongJvmTargetVersion.out @@ -1,3 +1,3 @@ error: unknown JVM target version: 1.5 -Supported versions: 1.6, 1.8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 +Supported versions: 1.6, 1.8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 COMPILATION_ERROR diff --git a/compiler/testData/codegen/box/annotations/typeAnnotations/implicitReturn.kt b/compiler/testData/codegen/box/annotations/typeAnnotations/implicitReturn.kt index d17f56e843a..0fd9eb7edec 100644 --- a/compiler/testData/codegen/box/annotations/typeAnnotations/implicitReturn.kt +++ b/compiler/testData/codegen/box/annotations/typeAnnotations/implicitReturn.kt @@ -11,14 +11,12 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE_USE) +@interface TypeAnn {} public class ImplicitReturn { - - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE_USE) - public @ interface TypeAnn {} - - @ImplicitReturn.TypeAnn + @TypeAnn public String bar() { return "OK"; } @@ -45,14 +43,14 @@ fun box(): String { checkTypeAnnotation( Kotlin::foo.javaMethod!!.annotatedReturnType, "class java.lang.String", - "@ImplicitReturn\$TypeAnn()", + "@TypeAnn()", "foo" ) checkTypeAnnotation( Kotlin::field.javaField!!.annotatedType, "class java.lang.String", - "@ImplicitReturn\$TypeAnn()", + "@TypeAnn()", "foo" ) diff --git a/compiler/testData/codegen/box/annotations/typeAnnotations/implicitReturnAgainstCompiled.kt b/compiler/testData/codegen/box/annotations/typeAnnotations/implicitReturnAgainstCompiled.kt index e7b6742e77f..64ec0fad834 100644 --- a/compiler/testData/codegen/box/annotations/typeAnnotations/implicitReturnAgainstCompiled.kt +++ b/compiler/testData/codegen/box/annotations/typeAnnotations/implicitReturnAgainstCompiled.kt @@ -12,14 +12,12 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE_USE) +@interface TypeAnn {} public class ImplicitReturn { - - @Retention(RetentionPolicy.RUNTIME) - @Target(ElementType.TYPE_USE) - public @ interface TypeAnn {} - - @ImplicitReturn.TypeAnn + @TypeAnn public String bar() { return "OK"; } @@ -47,14 +45,14 @@ fun box(): String { checkTypeAnnotation( Kotlin::foo.javaMethod!!.annotatedReturnType, "class java.lang.String", - "@ImplicitReturn\$TypeAnn()", + "@TypeAnn()", "foo" ) checkTypeAnnotation( Kotlin::field.javaField!!.annotatedType, "class java.lang.String", - "@ImplicitReturn\$TypeAnn()", + "@TypeAnn()", "foo" ) diff --git a/compiler/testData/codegen/box/reflection/annotations/localClassLiteral.kt b/compiler/testData/codegen/box/reflection/annotations/localClassLiteral.kt index 7b50dad81a7..f0545ab3ddd 100644 --- a/compiler/testData/codegen/box/reflection/annotations/localClassLiteral.kt +++ b/compiler/testData/codegen/box/reflection/annotations/localClassLiteral.kt @@ -17,11 +17,13 @@ fun box(): String { // JDK 8 and earlier val expected1 = "[@test.Anno(k1=class $fqName, k2=class [L$fqName;, k3=class [[L$fqName;)]" - // JDK 9 and later + // JDK 9..18 val expected2 = "[@test.Anno(k1=$fqName.class, k2=$fqName[].class, k3=$fqName[][].class)]" + // JDK 19 and later + val expected3 = "[@test.Anno(k1=.class, k2=.class, k3=.class)]" val actual = M::class.annotations.toString() - if (actual != expected1 && actual != expected2) return "Fail: $actual" + if (actual != expected1 && actual != expected2 && actual != expected3) return "Fail: $actual" return "OK" } diff --git a/libraries/tools/binary-compatibility-validator/reference-public-api/kotlin-gradle-plugin-api.txt b/libraries/tools/binary-compatibility-validator/reference-public-api/kotlin-gradle-plugin-api.txt index 876ab5b58bd..dc4bdeab763 100644 --- a/libraries/tools/binary-compatibility-validator/reference-public-api/kotlin-gradle-plugin-api.txt +++ b/libraries/tools/binary-compatibility-validator/reference-public-api/kotlin-gradle-plugin-api.txt @@ -118,6 +118,7 @@ public final class org/jetbrains/kotlin/gradle/dsl/JvmTarget : java/lang/Enum { public static final field JVM_16 Lorg/jetbrains/kotlin/gradle/dsl/JvmTarget; public static final field JVM_17 Lorg/jetbrains/kotlin/gradle/dsl/JvmTarget; public static final field JVM_18 Lorg/jetbrains/kotlin/gradle/dsl/JvmTarget; + public static final field JVM_19 Lorg/jetbrains/kotlin/gradle/dsl/JvmTarget; public static final field JVM_1_8 Lorg/jetbrains/kotlin/gradle/dsl/JvmTarget; public static final field JVM_9 Lorg/jetbrains/kotlin/gradle/dsl/JvmTarget; public final fun getTarget ()Ljava/lang/String; diff --git a/libraries/tools/kotlin-gradle-compiler-types/src/generated/kotlin/org/jetbrains/kotlin/gradle/dsl/JvmTarget.kt b/libraries/tools/kotlin-gradle-compiler-types/src/generated/kotlin/org/jetbrains/kotlin/gradle/dsl/JvmTarget.kt index affe9e2db7c..e843cd1bd7a 100644 --- a/libraries/tools/kotlin-gradle-compiler-types/src/generated/kotlin/org/jetbrains/kotlin/gradle/dsl/JvmTarget.kt +++ b/libraries/tools/kotlin-gradle-compiler-types/src/generated/kotlin/org/jetbrains/kotlin/gradle/dsl/JvmTarget.kt @@ -17,6 +17,7 @@ enum class JvmTarget(val target: String) { JVM_16("16"), JVM_17("17"), JVM_18("18"), + JVM_19("19"), ; companion object { diff --git a/libraries/tools/kotlin-gradle-plugin-api/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/CompilerJvmOptions.kt b/libraries/tools/kotlin-gradle-plugin-api/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/CompilerJvmOptions.kt index 09847983774..7666cf18353 100644 --- a/libraries/tools/kotlin-gradle-plugin-api/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/CompilerJvmOptions.kt +++ b/libraries/tools/kotlin-gradle-plugin-api/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/CompilerJvmOptions.kt @@ -15,8 +15,8 @@ interface CompilerJvmOptions : org.jetbrains.kotlin.gradle.dsl.CompilerCommonOpt val javaParameters: org.gradle.api.provider.Property /** - * Target version of the generated JVM bytecode (1.8, 9, 10, ..., 18), default is 1.8 - * Possible values: "1.8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18" + * Target version of the generated JVM bytecode (1.8, 9, 10, ..., 19), default is 1.8 + * Possible values: "1.8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19" * Default value: null */ @get:org.gradle.api.tasks.Optional diff --git a/libraries/tools/kotlin-gradle-plugin-api/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinJvmOptions.kt b/libraries/tools/kotlin-gradle-plugin-api/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinJvmOptions.kt index cf39511eb16..9985313ae8e 100644 --- a/libraries/tools/kotlin-gradle-plugin-api/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinJvmOptions.kt +++ b/libraries/tools/kotlin-gradle-plugin-api/src/common/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinJvmOptions.kt @@ -22,8 +22,8 @@ interface KotlinJvmOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonOptions private val org.jetbrains.kotlin.gradle.dsl.JvmTarget?.jvmTargetKotlinOption get() = this?.target /** - * Target version of the generated JVM bytecode (1.8, 9, 10, ..., 18), default is 1.8 - * Possible values: "1.8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18" + * Target version of the generated JVM bytecode (1.8, 9, 10, ..., 19), default is 1.8 + * Possible values: "1.8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19" * Default value: null */ var jvmTarget: kotlin.String?