Update CLI tests

This commit is contained in:
Mikhael Bogdanov
2021-07-15 06:27:14 +02:00
parent 1187e786f4
commit 7854e9c3d7
70 changed files with 117 additions and 188 deletions
@@ -1,2 +1,2 @@
error: language version 1.1 is no longer supported; please, use version 1.3 or greater.
error: language version 1.1 is no longer supported; please, use version 1.4 or greater.
COMPILATION_ERROR
+1 -1
View File
@@ -2,4 +2,4 @@ $TESTDATA_DIR$/apiVersion.kt
-d
$TEMP_DIR$
-api-version
1.3
1.4
+1 -1
View File
@@ -1,4 +1,4 @@
warning: API version 1.3 is deprecated and its support will be removed in a future version of Kotlin
warning: API version 1.4 is deprecated and its support will be removed in a future version of Kotlin
compiler/testData/cli/jvm/apiVersion.kt:4:5: warning: parameter 'p00' is never used
p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A,
^
@@ -2,4 +2,4 @@ $TESTDATA_DIR$/apiVersionAndSinceNewerKotlin.kt
-d
$TEMP_DIR$
-api-version
1.3
1.4
+2 -2
View File
@@ -1,5 +1,5 @@
@SinceKotlin("1.3")
@SinceKotlin("1.4")
fun old() {}
@SinceKotlin("1.4")
@SinceKotlin("1.5")
fun new() {}
@@ -1,5 +1,5 @@
warning: API version 1.3 is deprecated and its support will be removed in a future version of Kotlin
compiler/testData/cli/jvm/apiVersionAndSinceNewerKotlin.kt:4:1: warning: the version is greater than the specified API version 1.3
@SinceKotlin("1.4")
warning: API version 1.4 is deprecated and its support will be removed in a future version of Kotlin
compiler/testData/cli/jvm/apiVersionAndSinceNewerKotlin.kt:4:1: warning: the version is greater than the specified API version 1.4
@SinceKotlin("1.5")
^
OK
@@ -2,6 +2,6 @@ $TESTDATA_DIR$/apiVersion.kt
-d
$TEMP_DIR$
-api-version
1.4
1.5
-language-version
1.3
1.4
@@ -1,3 +1,3 @@
error: -api-version (1.4) cannot be greater than -language-version (1.3)
warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin
error: -api-version (1.5) cannot be greater than -language-version (1.4)
warning: language version 1.4 is deprecated and its support will be removed in a future version of Kotlin
COMPILATION_ERROR
+1 -1
View File
@@ -1,3 +1,3 @@
error: unknown API version: 239.42
Supported API versions: 1.3 (DEPRECATED), 1.4, 1.5, 1.6 (EXPERIMENTAL), 1.7 (EXPERIMENTAL)
Supported API versions: 1.4 (DEPRECATED), 1.5, 1.6, 1.7 (EXPERIMENTAL)
COMPILATION_ERROR
@@ -1 +1 @@
$TESTDATA_DIR$/apiVersion.kt -d $TEMP_DIR$ -api-version 1.3 -language-version 1.4
$TESTDATA_DIR$/apiVersion.kt -d $TEMP_DIR$ -api-version 1.4 -language-version 1.5
+2 -2
View File
@@ -2,6 +2,6 @@ $TESTDATA_DIR$/apiVersion.kt
-d
$TEMP_DIR$
-api-version
1.3
-language-version
1.4
-language-version
1.5
+1 -1
View File
@@ -1,4 +1,4 @@
warning: API version 1.3 is deprecated and its support will be removed in a future version of Kotlin
warning: API version 1.4 is deprecated and its support will be removed in a future version of Kotlin
compiler/testData/cli/jvm/apiVersion.kt:4:5: warning: parameter 'p00' is never used
p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A,
^
@@ -1,4 +1,4 @@
warning: API version 1.3 is deprecated and its support will be removed in a future version of Kotlin
warning: API version 1.4 is deprecated and its support will be removed in a future version of Kotlin
compiler/testData/cli/jvm/apiVersion.kt:4:5: warning: parameter 'p00' is never used
p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A,
^
+1 -1
View File
@@ -1,2 +1,2 @@
error: API version 1.1 is no longer supported; please, use version 1.3 or greater.
error: API version 1.1 is no longer supported; please, use version 1.4 or greater.
COMPILATION_ERROR
+1 -1
View File
@@ -2,4 +2,4 @@
-X'single \" quote " escaped \' sequence \\'
$TESTDATA_DIR$/apiVersion.kt
-d
$TEMP_DIR$ -api-version 1.3 -language-version 1.4
$TEMP_DIR$ -api-version 1.4 -language-version 1.5
+1 -1
View File
@@ -1,6 +1,6 @@
warning: flag is not supported by this version of the compiler: -Xdouble ' quote ' escaped " sequence /
warning: flag is not supported by this version of the compiler: -Xsingle " quote " escaped ' sequence /
warning: API version 1.3 is deprecated and its support will be removed in a future version of Kotlin
warning: API version 1.4 is deprecated and its support will be removed in a future version of Kotlin
compiler/testData/cli/jvm/apiVersion.kt:4:5: warning: parameter 'p00' is never used
p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A,
^
+1 -1
View File
@@ -2,4 +2,4 @@ $TESTDATA_DIR$/simple.kt
-d
$TEMP_DIR$
-api-version
1.3
1.4
+1 -1
View File
@@ -1,2 +1,2 @@
warning: API version 1.3 is deprecated and its support will be removed in a future version of Kotlin
warning: API version 1.4 is deprecated and its support will be removed in a future version of Kotlin
OK
@@ -1,2 +1,2 @@
error: language version 1.2 is no longer supported; please, use version 1.3 or greater.
error: language version 1.2 is no longer supported; please, use version 1.4 or greater.
COMPILATION_ERROR
+1 -1
View File
@@ -2,4 +2,4 @@ $TESTDATA_DIR$/simple.kt
-d
$TEMP_DIR$
-language-version
1.3
1.4
+1 -1
View File
@@ -1,2 +1,2 @@
warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin
warning: language version 1.4 is deprecated and its support will be removed in a future version of Kotlin
OK
@@ -2,5 +2,5 @@ $TESTDATA_DIR$/variableInWhenSubject.kt
-d
$TEMP_DIR$
-language-version
1.3
1.4
-XXLanguage\:+VariableDeclarationInWhenSubject
@@ -7,5 +7,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: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin
warning: language version 1.4 is deprecated and its support will be removed in a future version of Kotlin
OK
@@ -2,5 +2,5 @@ $TESTDATA_DIR$/simple.kt
-d
$TEMP_DIR$
-language-version
1.3
1.4
-XXLanguage\:+RestrictReturnStatementTarget
@@ -1,2 +1,2 @@
warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin
warning: language version 1.4 is deprecated and its support will be removed in a future version of Kotlin
OK
@@ -7,7 +7,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!
compiler/testData/cli/jvm/inlineClass.kt:1:1: warning: 'inline' modifier is deprecated. Use 'value' instead
inline class Foo(val x: Int)
^
OK
error: the following features cannot be disabled manually, because the version they first appeared in is no longer supported:
InlineClasses
COMPILATION_ERROR
@@ -1,8 +0,0 @@
$TESTDATA_DIR$/simple.kt
-d
$TEMP_DIR$
-language-version
1.4
-api-version
1.3
-Xuse-ir
-2
View File
@@ -1,2 +0,0 @@
warning: API version 1.3 is deprecated and its support will be removed in a future version of Kotlin
OK
@@ -1,6 +0,0 @@
$TESTDATA_DIR$/simple.kt
-d
$TEMP_DIR$
-language-version
1.3
-Xuse-ir
@@ -1,2 +0,0 @@
warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin
OK
+2 -2
View File
@@ -2,7 +2,7 @@ $TESTDATA_DIR$/simple.kt
-d
$TEMP_DIR$
-language-version
1.3
1.4
-api-version
1.3
1.4
-Xuse-ir
+1 -1
View File
@@ -1,2 +1,2 @@
warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin
warning: language version 1.4 is deprecated and its support will be removed in a future version of Kotlin
OK
-1
View File
@@ -1,4 +1,3 @@
warning: language version 1.6 is experimental, there are no backwards compatibility guarantees for new language and library features
compiler/testData/cli/jvm/jspecifyUsage.kt:2:11: error: null can not be a value of a non-null type String
a.foo(null)
^
+2 -5
View File
@@ -1,7 +1,4 @@
compiler/testData/cli/jvm/jspecifyUsage.kt:2:11: warning: type mismatch: inferred type is Nothing? but String was expected
compiler/testData/cli/jvm/jspecifyUsage.kt:2:11: error: null can not be a value of a non-null type String
a.foo(null)
^
compiler/testData/cli/jvm/jspecifyUsage.kt:3:5: warning: unsafe use of a nullable receiver of type String?
a.bar().hashCode()
^
OK
COMPILATION_ERROR
+1
View File
@@ -1 +1,2 @@
warning: language version 1.4 is deprecated and its support will be removed in a future version of Kotlin
OK
+1 -1
View File
@@ -1,5 +1,5 @@
$TESTDATA_DIR$/kt19628_13.kt
-language-version
1.3
1.4
-d
$TEMP_DIR$
+1 -1
View File
@@ -1,4 +1,4 @@
warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin
warning: language version 1.4 is deprecated and its support will be removed in a future version of Kotlin
compiler/testData/cli/jvm/kt19628_13.kt:5:29: error: unresolved reference: CollapsedStringAdapter
@get:XmlJavaTypeAdapter(CollapsedStringAdapter::class)
^
+1 -7
View File
@@ -1,9 +1,3 @@
package test
fun test() {
while (true) {
when {
true -> break
}
}
}
sealed interface Polygon
+5 -1
View File
@@ -1 +1,5 @@
OK
warning: language version 1.4 is deprecated and its support will be removed in a future version of Kotlin
compiler/testData/cli/jvm/languageVersion.kt:3:1: error: the feature "sealed interfaces" is only available since language version 1.5
sealed interface Polygon
^
COMPILATION_ERROR
+1 -1
View File
@@ -1,3 +1,3 @@
error: unknown language version: 239.42
Supported language versions: 1.3 (DEPRECATED), 1.4, 1.5, 1.6 (EXPERIMENTAL), 1.7 (EXPERIMENTAL)
Supported language versions: 1.4 (DEPRECATED), 1.5, 1.6, 1.7 (EXPERIMENTAL)
COMPILATION_ERROR
+1 -1
View File
@@ -1,2 +1,2 @@
error: language version 1.1 is no longer supported; please, use version 1.3 or greater.
error: language version 1.1 is no longer supported; please, use version 1.4 or greater.
COMPILATION_ERROR
@@ -1 +1 @@
$TEMP_DIR$ -api-version 1.3 -language-version 1.4
$TEMP_DIR$ -api-version 1.4 -language-version 1.5
+1 -1
View File
@@ -1,4 +1,4 @@
warning: API version 1.3 is deprecated and its support will be removed in a future version of Kotlin
warning: API version 1.4 is deprecated and its support will be removed in a future version of Kotlin
compiler/testData/cli/jvm/apiVersion.kt:4:5: warning: parameter 'p00' is never used
p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A,
^
+1 -1
View File
@@ -2,4 +2,4 @@ $TESTDATA_DIR$/progressive
-d
$TEMP_DIR$
-language-version
1.4
1.5
@@ -1,3 +1,4 @@
warning: language version 1.4 is deprecated and its support will be removed in a future version of Kotlin
compiler/testData/cli/jvm/resultInReturnType.kt:1:5: error: 'kotlin.Result' cannot be used as a return type
fun foo() = Result.success(42)
^
@@ -1,3 +1,4 @@
warning: language version 1.4 is deprecated and its support will be removed in a future version of Kotlin
compiler/testData/cli/jvm/resultInReturnType.kt:1:5: error: 'kotlin.Result' cannot be used as a return type
fun foo() = Result.success(42)
^
@@ -7,6 +7,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: language version 1.4 is deprecated and its support will be removed in a future version of Kotlin
compiler/testData/cli/jvm/resultInReturnType.kt:1:5: error: 'kotlin.Result' cannot be used as a return type
fun foo() = Result.success(42)
^
@@ -1,5 +0,0 @@
$TESTDATA_DIR$/standaloneSamConversionsAreEnabledWithNewInference.kt
-d
$TEMP_DIR$
-language-version
1.3
@@ -1,8 +0,0 @@
warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin
compiler/testData/cli/jvm/standaloneSamConversionsAreEnabledWithNewInference.kt:9:25: error: type mismatch: inferred type is () -> Unit but Runnable was expected
ForceSam.compare(r, {})
^
compiler/testData/cli/jvm/standaloneSamConversionsAreEnabledWithNewInference.kt:10:22: error: type mismatch: inferred type is () -> Unit but Runnable was expected
ForceSam.compare({}, r)
^
COMPILATION_ERROR
@@ -2,4 +2,4 @@ $TESTDATA_DIR$/useDeclarationThatWasExperimentalWithoutExplicitImport.kt
-d
$TEMP_DIR$
-language-version
1.3
1.4
@@ -1,7 +1,5 @@
@ExperimentalStdlibApi
fun test(s: ArrayDeque<Int>): ArrayDeque<Int>? {
ArrayDeque<Int>(42)
val x: ArrayDeque<Int>? = null
return x ?: s
}
fun test() {
"".lowercase()
1.digitToChar()
}
@@ -1,2 +1,2 @@
warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin
warning: language version 1.4 is deprecated and its support will be removed in a future version of Kotlin
OK
@@ -2,6 +2,6 @@ $TESTDATA_DIR$/useDeclarationThatWasExperimentalWithoutMarker.kt
-d
$TEMP_DIR$
-language-version
1.3
1.4
-opt-in
kotlin.ExperimentalStdlibApi
@@ -1,2 +1,2 @@
warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin
warning: language version 1.4 is deprecated and its support will be removed in a future version of Kotlin
OK
@@ -2,4 +2,4 @@ $TESTDATA_DIR$/useDeclarationThatWasExperimentalWithoutMarker.kt
-d
$TEMP_DIR$
-language-version
1.3
1.4
@@ -1,6 +1,4 @@
fun test(s: ArrayDeque<Int>): ArrayDeque<Int>? {
ArrayDeque<Int>(42)
val x: ArrayDeque<Int>? = null
return x ?: s
}
fun test() {
"".lowercase()
1.digitToChar()
}
@@ -1,23 +1,8 @@
warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin
compiler/testData/cli/jvm/useDeclarationThatWasExperimentalWithoutMarker.kt:1:13: error: this declaration is experimental and its usage must be marked with '@kotlin.ExperimentalStdlibApi' or '@OptIn(kotlin.ExperimentalStdlibApi::class)'
fun test(s: ArrayDeque<Int>): ArrayDeque<Int>? {
^
compiler/testData/cli/jvm/useDeclarationThatWasExperimentalWithoutMarker.kt:1:31: error: this declaration is experimental and its usage must be marked with '@kotlin.ExperimentalStdlibApi' or '@OptIn(kotlin.ExperimentalStdlibApi::class)'
fun test(s: ArrayDeque<Int>): ArrayDeque<Int>? {
^
compiler/testData/cli/jvm/useDeclarationThatWasExperimentalWithoutMarker.kt:2:5: error: unresolved reference: ArrayDeque
ArrayDeque<Int>(42)
^
compiler/testData/cli/jvm/useDeclarationThatWasExperimentalWithoutMarker.kt:4:12: error: this declaration is experimental and its usage must be marked with '@kotlin.ExperimentalStdlibApi' or '@OptIn(kotlin.ExperimentalStdlibApi::class)'
val x: ArrayDeque<Int>? = null
^
compiler/testData/cli/jvm/useDeclarationThatWasExperimentalWithoutMarker.kt:5:12: error: this declaration is experimental and its usage must be marked with '@kotlin.ExperimentalStdlibApi' or '@OptIn(kotlin.ExperimentalStdlibApi::class)'
return x ?: s
^
compiler/testData/cli/jvm/useDeclarationThatWasExperimentalWithoutMarker.kt:5:14: error: this declaration is experimental and its usage must be marked with '@kotlin.ExperimentalStdlibApi' or '@OptIn(kotlin.ExperimentalStdlibApi::class)'
return x ?: s
^
compiler/testData/cli/jvm/useDeclarationThatWasExperimentalWithoutMarker.kt:5:17: error: this declaration is experimental and its usage must be marked with '@kotlin.ExperimentalStdlibApi' or '@OptIn(kotlin.ExperimentalStdlibApi::class)'
return x ?: s
^
warning: language version 1.4 is deprecated and its support will be removed in a future version of Kotlin
compiler/testData/cli/jvm/useDeclarationThatWasExperimentalWithoutMarker.kt:2:8: error: unresolved reference: lowercase
"".lowercase()
^
compiler/testData/cli/jvm/useDeclarationThatWasExperimentalWithoutMarker.kt:3:7: error: unresolved reference: digitToChar
1.digitToChar()
^
COMPILATION_ERROR
@@ -0,0 +1,5 @@
$TESTDATA_DIR$/useDeclarationThatWasExperimentalWithoutMarker2.kt
-d
$TEMP_DIR$
-language-version
1.4
@@ -0,0 +1,5 @@
//This test is extracted from useDeclarationThatWasExperimentalWithoutMarker.kt to check warnings in ouput
fun test(p: ULong) {
val z: ULong = p
z.inv()
}
@@ -0,0 +1,17 @@
warning: language version 1.4 is deprecated and its support will be removed in a future version of Kotlin
compiler/testData/cli/jvm/useDeclarationThatWasExperimentalWithoutMarker2.kt:2:13: warning: this declaration is experimental and its usage should be marked with '@kotlin.ExperimentalUnsignedTypes' or '@OptIn(kotlin.ExperimentalUnsignedTypes::class)'
fun test(p: ULong) {
^
compiler/testData/cli/jvm/useDeclarationThatWasExperimentalWithoutMarker2.kt:3:12: warning: this declaration is experimental and its usage should be marked with '@kotlin.ExperimentalUnsignedTypes' or '@OptIn(kotlin.ExperimentalUnsignedTypes::class)'
val z: ULong = p
^
compiler/testData/cli/jvm/useDeclarationThatWasExperimentalWithoutMarker2.kt:3:20: warning: this declaration is experimental and its usage should be marked with '@kotlin.ExperimentalUnsignedTypes' or '@OptIn(kotlin.ExperimentalUnsignedTypes::class)'
val z: ULong = p
^
compiler/testData/cli/jvm/useDeclarationThatWasExperimentalWithoutMarker2.kt:4:5: warning: this declaration is experimental and its usage should be marked with '@kotlin.ExperimentalUnsignedTypes' or '@OptIn(kotlin.ExperimentalUnsignedTypes::class)'
z.inv()
^
compiler/testData/cli/jvm/useDeclarationThatWasExperimentalWithoutMarker2.kt:4:7: warning: this declaration is experimental and its usage should be marked with '@kotlin.ExperimentalUnsignedTypes' or '@OptIn(kotlin.ExperimentalUnsignedTypes::class)'
z.inv()
^
OK
+1 -1
View File
@@ -2,5 +2,5 @@ $TESTDATA_DIR$/variableInWhenSubject.kt
-d
$TEMP_DIR$
-language-version
1.3
1.4
-XXLanguage\:+VariableDeclarationInWhenSubject
+1 -1
View File
@@ -7,5 +7,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: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin
warning: language version 1.4 is deprecated and its support will be removed in a future version of Kotlin
OK