Introduce language version 2.1
This commit is contained in:
@@ -26,6 +26,7 @@ private val LANGUAGE_TO_METADATA_VERSION = EnumMap<LanguageVersion, JvmMetadataV
|
||||
this[LanguageVersion.KOTLIN_1_8] = JvmMetadataVersion(1, 8, 0)
|
||||
this[LanguageVersion.KOTLIN_1_9] = JvmMetadataVersion.INSTANCE
|
||||
this[LanguageVersion.KOTLIN_2_0] = JvmMetadataVersion(2, 0, 0)
|
||||
this[LanguageVersion.KOTLIN_2_1] = JvmMetadataVersion(2, 1, 0)
|
||||
|
||||
check(size == LanguageVersion.values().size) {
|
||||
"Please add mappings from the missing LanguageVersion instances to the corresponding JvmMetadataVersion " +
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
error: unknown API version: 239.42
|
||||
Supported API versions: 1.4 (deprecated), 1.5 (deprecated), 1.6, 1.7, 1.8, 1.9, 2.0 (experimental)
|
||||
Supported API versions: 1.4 (deprecated), 1.5 (deprecated), 1.6, 1.7, 1.8, 1.9, 2.0 (experimental), 2.1 (experimental)
|
||||
COMPILATION_ERROR
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
error: unknown language version: 239.42
|
||||
Supported language versions: 1.4 (deprecated), 1.5 (deprecated), 1.6, 1.7, 1.8, 1.9, 2.0 (experimental)
|
||||
Supported language versions: 1.4 (deprecated), 1.5 (deprecated), 1.6, 1.7, 1.8, 1.9, 2.0 (experimental), 2.1 (experimental)
|
||||
COMPILATION_ERROR
|
||||
|
||||
@@ -66,6 +66,9 @@ class ApiVersion private constructor(
|
||||
@JvmField
|
||||
val KOTLIN_2_0 = createByLanguageVersion(LanguageVersion.KOTLIN_2_0)
|
||||
|
||||
@JvmField
|
||||
val KOTLIN_2_1 = createByLanguageVersion(LanguageVersion.KOTLIN_2_1)
|
||||
|
||||
@JvmField
|
||||
val LATEST: ApiVersion = createByLanguageVersion(LanguageVersion.values().last())
|
||||
|
||||
|
||||
@@ -288,6 +288,8 @@ enum class LanguageFeature(
|
||||
ForbidInferringPostponedTypeVariableIntoDeclaredUpperBound(KOTLIN_2_0, kind = BUG_FIX), // KT-47986
|
||||
ProhibitUseSiteGetTargetAnnotations(KOTLIN_2_0, kind = BUG_FIX), // KT-15470
|
||||
|
||||
// 2.1
|
||||
|
||||
// End of 2.* language features --------------------------------------------------
|
||||
|
||||
// This feature effectively might be removed because we decided to disable it until K2 and there it will be unconditionally enabled.
|
||||
@@ -426,6 +428,7 @@ enum class LanguageVersion(val major: Int, val minor: Int) : DescriptionAware, L
|
||||
KOTLIN_1_9(1, 9),
|
||||
|
||||
KOTLIN_2_0(2, 0),
|
||||
KOTLIN_2_1(2, 1),
|
||||
;
|
||||
|
||||
override val isStable: Boolean
|
||||
|
||||
+1
@@ -17,6 +17,7 @@ enum class KotlinVersion(val version: String) {
|
||||
KOTLIN_1_8("1.8"),
|
||||
KOTLIN_1_9("1.9"),
|
||||
KOTLIN_2_0("2.0"),
|
||||
KOTLIN_2_1("2.1"),
|
||||
;
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -550,6 +550,7 @@ public final class org/jetbrains/kotlin/gradle/dsl/KotlinVersion : java/lang/Enu
|
||||
public static final field KOTLIN_1_8 Lorg/jetbrains/kotlin/gradle/dsl/KotlinVersion;
|
||||
public static final field KOTLIN_1_9 Lorg/jetbrains/kotlin/gradle/dsl/KotlinVersion;
|
||||
public static final field KOTLIN_2_0 Lorg/jetbrains/kotlin/gradle/dsl/KotlinVersion;
|
||||
public static final field KOTLIN_2_1 Lorg/jetbrains/kotlin/gradle/dsl/KotlinVersion;
|
||||
public final fun getVersion ()Ljava/lang/String;
|
||||
public static fun valueOf (Ljava/lang/String;)Lorg/jetbrains/kotlin/gradle/dsl/KotlinVersion;
|
||||
public static fun values ()[Lorg/jetbrains/kotlin/gradle/dsl/KotlinVersion;
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@ interface KotlinCommonCompilerOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCo
|
||||
|
||||
/**
|
||||
* Allow using declarations only from the specified version of bundled libraries
|
||||
* Possible values: "1.4 (deprecated)", "1.5 (deprecated)", "1.6", "1.7", "1.8", "1.9", "2.0 (experimental)"
|
||||
* Possible values: "1.4 (deprecated)", "1.5 (deprecated)", "1.6", "1.7", "1.8", "1.9", "2.0 (experimental)", "2.1 (experimental)"
|
||||
* Default value: null
|
||||
*/
|
||||
@get:org.gradle.api.tasks.Optional
|
||||
@@ -18,7 +18,7 @@ interface KotlinCommonCompilerOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCo
|
||||
|
||||
/**
|
||||
* Provide source compatibility with the specified version of Kotlin
|
||||
* Possible values: "1.4 (deprecated)", "1.5 (deprecated)", "1.6", "1.7", "1.8", "1.9", "2.0 (experimental)"
|
||||
* Possible values: "1.4 (deprecated)", "1.5 (deprecated)", "1.6", "1.7", "1.8", "1.9", "2.0 (experimental)", "2.1 (experimental)"
|
||||
* Default value: null
|
||||
*/
|
||||
@get:org.gradle.api.tasks.Optional
|
||||
|
||||
+2
-2
@@ -14,7 +14,7 @@ interface KotlinCommonOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonTool
|
||||
|
||||
/**
|
||||
* Allow using declarations only from the specified version of bundled libraries
|
||||
* Possible values: "1.4 (deprecated)", "1.5 (deprecated)", "1.6", "1.7", "1.8", "1.9", "2.0 (experimental)"
|
||||
* Possible values: "1.4 (deprecated)", "1.5 (deprecated)", "1.6", "1.7", "1.8", "1.9", "2.0 (experimental)", "2.1 (experimental)"
|
||||
* Default value: null
|
||||
*/
|
||||
var apiVersion: kotlin.String?
|
||||
@@ -27,7 +27,7 @@ interface KotlinCommonOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonTool
|
||||
|
||||
/**
|
||||
* Provide source compatibility with the specified version of Kotlin
|
||||
* Possible values: "1.4 (deprecated)", "1.5 (deprecated)", "1.6", "1.7", "1.8", "1.9", "2.0 (experimental)"
|
||||
* Possible values: "1.4 (deprecated)", "1.5 (deprecated)", "1.6", "1.7", "1.8", "1.9", "2.0 (experimental)", "2.1 (experimental)"
|
||||
* Default value: null
|
||||
*/
|
||||
var languageVersion: kotlin.String?
|
||||
|
||||
+1
@@ -148,6 +148,7 @@ private val apiVersionValues = ApiVersion.run {
|
||||
KOTLIN_1_8,
|
||||
KOTLIN_1_9,
|
||||
KOTLIN_2_0,
|
||||
KOTLIN_2_1,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user