diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/GenerationState.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/GenerationState.kt index 994118ff34c..a6d308afc0f 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/GenerationState.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/GenerationState.kt @@ -407,6 +407,7 @@ class GenerationState private constructor( this[KOTLIN_1_4] = JvmMetadataVersion(1, 4, 3) this[KOTLIN_1_5] = JvmMetadataVersion.INSTANCE this[KOTLIN_1_6] = JvmMetadataVersion(1, 6, 0) + this[KOTLIN_1_7] = JvmMetadataVersion(1, 7, 0) check(size == LanguageVersion.values().size) { "Please add mappings from the missing LanguageVersion instances to the corresponding JvmMetadataVersion " + diff --git a/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/directives/LanguageSettingsDirectives.kt b/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/directives/LanguageSettingsDirectives.kt index 0e7dbef2e3f..26de582f4f1 100644 --- a/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/directives/LanguageSettingsDirectives.kt +++ b/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/directives/LanguageSettingsDirectives.kt @@ -83,6 +83,7 @@ object LanguageSettingsDirectives : SimpleDirectivesContainer() { fun parseApiVersion(versionString: String): ApiVersion = when (versionString) { "LATEST" -> ApiVersion.LATEST + "LATEST_STABLE" -> ApiVersion.LATEST_STABLE else -> ApiVersion.parse(versionString) ?: error("Unknown API version: $versionString") } } diff --git a/compiler/testData/cli/jvm/apiVersionInvalid.out b/compiler/testData/cli/jvm/apiVersionInvalid.out index 78dcfeeec87..6113c28a544 100644 --- a/compiler/testData/cli/jvm/apiVersionInvalid.out +++ b/compiler/testData/cli/jvm/apiVersionInvalid.out @@ -1,3 +1,3 @@ error: unknown API version: 239.42 -Supported API versions: 1.3 (DEPRECATED), 1.4, 1.5, 1.6 (EXPERIMENTAL) +Supported API versions: 1.3 (DEPRECATED), 1.4, 1.5, 1.6 (EXPERIMENTAL), 1.7 (EXPERIMENTAL) COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/languageVersionInvalid.out b/compiler/testData/cli/jvm/languageVersionInvalid.out index 1289e703ebf..37c8add550b 100644 --- a/compiler/testData/cli/jvm/languageVersionInvalid.out +++ b/compiler/testData/cli/jvm/languageVersionInvalid.out @@ -1,3 +1,3 @@ error: unknown language version: 239.42 -Supported language versions: 1.3 (DEPRECATED), 1.4, 1.5, 1.6 (EXPERIMENTAL) +Supported language versions: 1.3 (DEPRECATED), 1.4, 1.5, 1.6 (EXPERIMENTAL), 1.7 (EXPERIMENTAL) COMPILATION_ERROR diff --git a/compiler/testData/codegen/bytecodeText/inlineClasses/resultApiEqualsDoesntBox.kt b/compiler/testData/codegen/bytecodeText/inlineClasses/resultApiEqualsDoesntBox.kt index 1044928f8cb..d0717e7cb87 100644 --- a/compiler/testData/codegen/bytecodeText/inlineClasses/resultApiEqualsDoesntBox.kt +++ b/compiler/testData/codegen/bytecodeText/inlineClasses/resultApiEqualsDoesntBox.kt @@ -1,4 +1,4 @@ -// !API_VERSION: LATEST +// !API_VERSION: LATEST_STABLE // WITH_RUNTIME // FILE: test.kt fun test() { diff --git a/compiler/testData/codegen/bytecodeText/notNullAssertions/assertionForNotNullTypeParam_1_4.kt b/compiler/testData/codegen/bytecodeText/notNullAssertions/assertionForNotNullTypeParam_1_4.kt index 19fd8a8de88..2867495c0ab 100644 --- a/compiler/testData/codegen/bytecodeText/notNullAssertions/assertionForNotNullTypeParam_1_4.kt +++ b/compiler/testData/codegen/bytecodeText/notNullAssertions/assertionForNotNullTypeParam_1_4.kt @@ -1,4 +1,4 @@ -// !API_VERSION: LATEST +// !API_VERSION: LATEST_STABLE fun foo(t: T) = t diff --git a/compiler/testData/codegen/bytecodeText/nullCheckOptimization/multipleExclExcl_1_4.kt b/compiler/testData/codegen/bytecodeText/nullCheckOptimization/multipleExclExcl_1_4.kt index 59b76a2cb5a..17600ad08e9 100644 --- a/compiler/testData/codegen/bytecodeText/nullCheckOptimization/multipleExclExcl_1_4.kt +++ b/compiler/testData/codegen/bytecodeText/nullCheckOptimization/multipleExclExcl_1_4.kt @@ -1,4 +1,4 @@ -// !API_VERSION: LATEST +// !API_VERSION: LATEST_STABLE fun test(s: String?): Int { s!! diff --git a/compiler/testData/codegen/bytecodeText/nullCheckOptimization/nullCheckAfterExclExcl_1_4.kt b/compiler/testData/codegen/bytecodeText/nullCheckOptimization/nullCheckAfterExclExcl_1_4.kt index 80c1c10fc7c..839d59b505c 100644 --- a/compiler/testData/codegen/bytecodeText/nullCheckOptimization/nullCheckAfterExclExcl_1_4.kt +++ b/compiler/testData/codegen/bytecodeText/nullCheckOptimization/nullCheckAfterExclExcl_1_4.kt @@ -1,4 +1,4 @@ -// !API_VERSION: LATEST +// !API_VERSION: LATEST_STABLE fun test(s: String?): Int { s!! diff --git a/compiler/testData/codegen/bytecodeText/nullCheckOptimization/redundantSafeCall_1_4.kt b/compiler/testData/codegen/bytecodeText/nullCheckOptimization/redundantSafeCall_1_4.kt index 535a79a29ec..47b84ef593a 100644 --- a/compiler/testData/codegen/bytecodeText/nullCheckOptimization/redundantSafeCall_1_4.kt +++ b/compiler/testData/codegen/bytecodeText/nullCheckOptimization/redundantSafeCall_1_4.kt @@ -1,8 +1,8 @@ -// !API_VERSION: LATEST +// !API_VERSION: LATEST_STABLE fun test(s: String) = s?.length // 0 IFNULL // 0 IFNONNULL // 0 intValue -// 1 valueOf +// 0 valueOf diff --git a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt index c9158937dda..48ee875b965 100644 --- a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt +++ b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt @@ -315,6 +315,7 @@ enum class LanguageVersion(val major: Int, val minor: Int) : DescriptionAware { KOTLIN_1_4(1, 4), KOTLIN_1_5(1, 5), KOTLIN_1_6(1, 6), + KOTLIN_1_7(1, 7), ; val isStable: Boolean