Introduce language version 2.0 and associate K2 compiler with it

This commit is contained in:
Mikhail Glukhikh
2022-11-28 18:20:10 +01:00
parent afe1150aec
commit 3dc05f4ec5
84 changed files with 233 additions and 151 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
$TESTDATA_DIR$/fir.kt
-Xuse-k2
-language-version
2.0
-ir-output-dir
$TEMP_DIR$
-ir-output-name
+1 -3
View File
@@ -1,4 +1,2 @@
warning: ATTENTION!
This build uses experimental K2 compiler:
-Xuse-k2
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
OK
+1 -1
View File
@@ -1,3 +1,3 @@
error: unknown API version: 239.42
Supported API versions: 1.3 (deprecated), 1.4 (deprecated), 1.5, 1.6, 1.7, 1.8, 1.9 (experimental)
Supported API versions: 1.3 (deprecated), 1.4 (deprecated), 1.5, 1.6, 1.7, 1.8, 1.9 (experimental), 2.0 (experimental)
COMPILATION_ERROR
@@ -1,4 +1,5 @@
$TESTDATA_DIR$/conflictingJvmDeclarations.kt
-Xuse-k2
-language-version
2.0
-d
$TEMP_DIR$
+1 -3
View File
@@ -1,6 +1,4 @@
warning: ATTENTION!
This build uses experimental K2 compiler:
-Xuse-k2
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
compiler/testData/cli/jvm/conflictingJvmDeclarations.kt:2:5: error: platform declaration clash: The following declarations have the same JVM signature (getX()I):
fun `<get-x>`(): Int defined in Foo
fun getX(): Int defined in Foo
+2 -1
View File
@@ -1,4 +1,5 @@
$TESTDATA_DIR$/conflictingProjection.kt
-Xuse-k2
-language-version
2.0
-d
$TEMP_DIR$
+1 -3
View File
@@ -1,6 +1,4 @@
warning: ATTENTION!
This build uses experimental K2 compiler:
-Xuse-k2
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
compiler/testData/cli/jvm/conflictingProjection.kt:10:19: error: projection is conflicting with variance of the corresponding type parameter of Out<in kotlin/Int>. Remove the projection or replace it with '*'
fun a8(value: Out<in Int>) {}
^
+2 -1
View File
@@ -1,5 +1,6 @@
$TESTDATA_DIR$/extendedCheckers.kt
-Xuse-k2
-language-version
2.0
-Xuse-fir-extended-checkers
-d
$TEMP_DIR$
+1 -3
View File
@@ -1,6 +1,4 @@
warning: ATTENTION!
This build uses experimental K2 compiler:
-Xuse-k2
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
compiler/testData/cli/jvm/extendedCheckers.kt:2:12: warning: redundant explicit type
val i: Int = 1
^
+2 -1
View File
@@ -1,5 +1,6 @@
$TESTDATA_DIR$/extendedCheckersNoWarning.kt
-Xuse-k2
-language-version
2.0
-Xuse-fir-extended-checkers
-d
$TEMP_DIR$
+1 -3
View File
@@ -1,4 +1,2 @@
warning: ATTENTION!
This build uses experimental K2 compiler:
-Xuse-k2
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
OK
+2 -1
View File
@@ -1,5 +1,6 @@
$TESTDATA_DIR$/firDeprecationJava.kt
$TESTDATA_DIR$/firDeprecationJava
-Xuse-k2
-language-version
2.0
-d
$TEMP_DIR$
+1 -3
View File
@@ -1,6 +1,4 @@
warning: ATTENTION!
This build uses experimental K2 compiler:
-Xuse-k2
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
compiler/testData/cli/jvm/firDeprecationJava.kt:3:12: warning: '@Deprecated(...) fun stop(): Unit
' is deprecated. Deprecated in Java
thread.stop()
+2 -1
View File
@@ -1,4 +1,5 @@
$TESTDATA_DIR$/firDfa.kt
-Xuse-k2
-language-version
2.0
-d
$TEMP_DIR$
+4 -3
View File
@@ -1,4 +1,5 @@
warning: ATTENTION!
This build uses experimental K2 compiler:
-Xuse-k2
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
compiler/testData/cli/jvm/firDfa.kt:3:10: warning: unnecessary non-null assertion (!!) on a non-null receiver of type kotlin/String
x!!.length
^
OK
+2 -1
View File
@@ -1,4 +1,5 @@
$TESTDATA_DIR$/firError.kt
-Xuse-k2
-language-version
2.0
-d
$TEMP_DIR$
+1 -3
View File
@@ -1,6 +1,4 @@
warning: ATTENTION!
This build uses experimental K2 compiler:
-Xuse-k2
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
compiler/testData/cli/jvm/firError.kt:1:13: error: 'val' on function parameter is not allowed
fun println(val x: Int) {}
^
+2 -3
View File
@@ -1,4 +1,3 @@
warning: ATTENTION!
This build uses experimental K2 compiler:
-Xuse-k2
warning: compiler flag -Xuse-k2 is deprecated, please use -language-version 2.0 instead
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
OK
+5
View File
@@ -0,0 +1,5 @@
$TESTDATA_DIR$/firHello20.kt
-language-version
2.0
-d
$TEMP_DIR$
+1
View File
@@ -0,0 +1 @@
fun main() {}
+2
View File
@@ -0,0 +1,2 @@
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
OK
+6
View File
@@ -0,0 +1,6 @@
$TESTDATA_DIR$/firHello20.kt
-Xuse-k2
-language-version
2.0
-d
$TEMP_DIR$
+3
View File
@@ -0,0 +1,3 @@
warning: compiler flag -Xuse-k2 is redundant
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
OK
+6
View File
@@ -0,0 +1,6 @@
$TESTDATA_DIR$/firHello20.kt
-Xuse-k2
-language-version
1.5
-d
$TEMP_DIR$
+3
View File
@@ -0,0 +1,3 @@
warning: with -Xuse-k2 compiler flag -language-version 1.5 has no effect, please remove -Xuse-k2 flag or use -language-version 2.0 instead
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
OK
@@ -2,7 +2,8 @@ $TESTDATA_DIR$/firMultiplatformCompilationWithError/common.kt
$TESTDATA_DIR$/firMultiplatformCompilationWithError/jvm.kt
-Xcommon-sources
$TESTDATA_DIR$/firMultiplatformCompilationWithError/common.kt
-Xuse-k2
-language-version
2.0
-cp
.
-d
@@ -8,9 +8,7 @@ This mode is not recommended for production use,
as no stability/compatibility guarantees are given on
compiler or generated code. Use it at your own risk!
warning: ATTENTION!
This build uses experimental K2 compiler:
-Xuse-k2
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
compiler/testData/cli/jvm/firMultiplatformCompilationWithError/jvm.kt:1:18: error: actual class 'actual interface A : Any' has no corresponding members for expected class members:
expect fun foo(): Unit
@@ -8,7 +8,6 @@ This mode is not recommended for production use,
as no stability/compatibility guarantees are given on
compiler or generated code. Use it at your own risk!
warning: ATTENTION!
This build uses experimental K2 compiler:
-Xuse-k2
warning: compiler flag -Xuse-k2 is deprecated, please use "-language-version 2.0" instead
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
OK
@@ -2,7 +2,8 @@ $TESTDATA_DIR$/firMultiplatformCompilationWithoutErrors/common.kt
$TESTDATA_DIR$/firMultiplatformCompilationWithoutErrors/jvm.kt
-Xcommon-sources
$TESTDATA_DIR$/firMultiplatformCompilationWithoutErrors/common.kt
-Xuse-k2
-language-version
2.0
-cp
.
-d
@@ -8,7 +8,5 @@ This mode is not recommended for production use,
as no stability/compatibility guarantees are given on
compiler or generated code. Use it at your own risk!
warning: ATTENTION!
This build uses experimental K2 compiler:
-Xuse-k2
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
OK
+2 -1
View File
@@ -1,5 +1,6 @@
$TESTDATA_DIR$/firStdlibDependency.kt
-Xuse-k2
-language-version
2.0
-cp
.
-d
+1 -3
View File
@@ -1,4 +1,2 @@
warning: ATTENTION!
This build uses experimental K2 compiler:
-Xuse-k2
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
OK
+2 -1
View File
@@ -1,6 +1,7 @@
$TESTDATA_DIR$/firVsClassicAnnotation.kt
-classpath
$TESTDATA_DIR$/firVsClassicAnnotation
-Xuse-k2
-language-version
2.0
-d
$TEMP_DIR$
+1 -3
View File
@@ -1,4 +1,2 @@
warning: ATTENTION!
This build uses experimental K2 compiler:
-Xuse-k2
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
OK
@@ -1,4 +1,5 @@
$TESTDATA_DIR$/inapplicableLateinitModifier.kt
-Xuse-k2
-language-version
2.0
-d
$TEMP_DIR$
+1 -3
View File
@@ -1,6 +1,4 @@
warning: ATTENTION!
This build uses experimental K2 compiler:
-Xuse-k2
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
compiler/testData/cli/jvm/inapplicableLateinitModifier.kt:6:1: error: 'lateinit' modifier is not allowed on delegated properties
lateinit var kest by Delegate
^
@@ -1,4 +1,5 @@
$TESTDATA_DIR$/instanceAccessBeforeSuperCall.kt
-Xuse-k2
-language-version
2.0
-d
$TEMP_DIR$
@@ -1,6 +1,4 @@
warning: ATTENTION!
This build uses experimental K2 compiler:
-Xuse-k2
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
compiler/testData/cli/jvm/instanceAccessBeforeSuperCall.kt:2:26: error: unresolved reference: getSomeInt
constructor(x: Int = getSomeInt(), other: A = this, header: String = keker) {}
^
+1 -1
View File
@@ -1,3 +1,3 @@
error: unknown language version: 239.42
Supported language versions: 1.3 (deprecated), 1.4 (deprecated), 1.5, 1.6, 1.7, 1.8, 1.9 (experimental)
Supported language versions: 1.3 (deprecated), 1.4 (deprecated), 1.5, 1.6, 1.7, 1.8, 1.9 (experimental), 2.0 (experimental)
COMPILATION_ERROR
+2 -1
View File
@@ -2,5 +2,6 @@ $TESTDATA_DIR$/optInEmptyMessageFir.kt
-d
$TEMP_DIR$
-opt-in=kotlin.RequiresOptIn
-Xuse-k2
-language-version
2.0
+1 -3
View File
@@ -1,6 +1,4 @@
warning: ATTENTION!
This build uses experimental K2 compiler:
-Xuse-k2
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
compiler/testData/cli/jvm/optInEmptyMessageFir.kt:8:5: error: this declaration needs opt-in. Its usage must be marked with '@EmptyMarker' or '@OptIn(EmptyMarker::class)'
foo()
^
+2 -1
View File
@@ -2,4 +2,5 @@ $TESTDATA_DIR$/optInOverrideMessageFir.kt
-d
$TEMP_DIR$
-opt-in=kotlin.RequiresOptIn
-Xuse-k2
-language-version
2.0
+1 -3
View File
@@ -1,6 +1,4 @@
warning: ATTENTION!
This build uses experimental K2 compiler:
-Xuse-k2
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
compiler/testData/cli/jvm/optInOverrideMessageFir.kt:16:18: error: base declaration of supertype 'Base' needs opt-in. This API is experimental and can change at any time, please use with care. The declaration override must be annotated with '@Marker' or '@OptIn(Marker::class)'
override fun foo() {}
^
@@ -1,5 +1,6 @@
-d
$TEMP_DIR$
-Xuse-k2
-language-version
2.0
-Xcompiler-plugin=dist/kotlinc/lib/allopen-compiler-plugin.jar=annotation=foo.AllOpen
$TESTDATA_DIR$/firAllOpenPlugin.kt
@@ -1,5 +1,3 @@
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
warning: argument -Xcompiler-plugin is experimental
warning: ATTENTION!
This build uses experimental K2 compiler:
-Xuse-k2
OK
@@ -1,8 +1,8 @@
-d
$TEMP_DIR$
-Xcompiler-plugin=dist/kotlinc/lib/noarg-compiler-plugin.jar=annotation=foo.NoArg
-Xuse-k2
-language-version
2.0
-Xplugin=dist/kotlinc/lib/allopen-compiler-plugin.jar
-P
plugin\:org.jetbrains.kotlin.allopen\:annotation=foo.AllOpen
@@ -1,3 +1,4 @@
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
error: mixing legacy and modern plugin arguments is prohibited. Please use only one syntax
Legacy arguments:
-Xplugin=dist/kotlinc/lib/allopen-compiler-plugin.jar
@@ -1,5 +1,6 @@
-d
$TEMP_DIR$
-Xuse-k2
-language-version
2.0
-Xcompiler-plugin=dist/kotlinc/lib/allopen-compiler-plugin.jar=annotation=foo.AllOpen1,annotation=foo.AllOpen2
$TESTDATA_DIR$/multipleOptionsForOnePlugin.kt
@@ -1,5 +1,3 @@
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
warning: argument -Xcompiler-plugin is experimental
warning: ATTENTION!
This build uses experimental K2 compiler:
-Xuse-k2
OK
+2 -1
View File
@@ -1,6 +1,7 @@
-d
$TEMP_DIR$
-Xuse-k2
-language-version
2.0
-Xcompiler-plugin=dist/kotlinc/lib/allopen-compiler-plugin.jar=annotation=foo.AllOpen
-Xcompiler-plugin=dist/kotlinc/lib/noarg-compiler-plugin.jar=annotation=foo.NoArg
$TESTDATA_DIR$/multiplePlugins.kt
+1 -3
View File
@@ -1,6 +1,4 @@
warning: ATTENTION!
This build uses experimental K2 compiler:
-Xuse-k2
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
compiler/testData/cli/jvm/plugins/multiplePlugins.kt:11:17: error:
inner class Inner(val s: String)
^
@@ -1,5 +1,6 @@
-d
$TEMP_DIR$
-Xuse-k2
-language-version
2.0
-Xcompiler-plugin=dist/kotlinc/lib/allopen-compiler-plugin.jar,dist/kotlinc/lib/noarg-compiler-plugin.jar=annotation=foo.AllOpen
$TESTDATA_DIR$/multiplePluginsInSameArg.kt
@@ -1,3 +1,4 @@
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
error: multiple plugins found in given classpath: org.jetbrains.kotlin.allopen.AllOpenComponentRegistrar, org.jetbrains.kotlin.noarg.NoArgComponentRegistrar
Plugin configuration is: dist/kotlinc/lib/allopen-compiler-plugin.jar,dist/kotlinc/lib/noarg-compiler-plugin.jar=annotation=foo.AllOpen
COMPILATION_ERROR
+2 -1
View File
@@ -1,5 +1,6 @@
-d
$TEMP_DIR$
-Xuse-k2
-language-version
2.0
-Xcompiler-plugin=dist/kotlinc/lib/kotlin-reflect.jar
$TESTDATA_DIR$/noPluginInClasspath.kt
@@ -1,2 +1,3 @@
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
error: no plugins found in given classpath: dist/kotlinc/lib/kotlin-reflect.jar
COMPILATION_ERROR
+2 -1
View File
@@ -1,4 +1,5 @@
$TESTDATA_DIR$/fir.kt
-Xuse-k2
-language-version
2.0
-d
$TEMP_DIR$
+2 -1
View File
@@ -1,2 +1,3 @@
error: k2 does not support compilation to metadata right now
warning: language version 2.0 is experimental, there are no backwards compatibility guarantees for new language and library features
error: compilation to metadata is not supported in language version 2.0 right now
COMPILATION_ERROR