Disable some features when LV=1.1 API=1.0.
Feature list: - bound callable references - local delegated properties - coroutines. #KT-16017 Fixed
This commit is contained in:
+4
-1
@@ -1,4 +1,7 @@
|
||||
compiler/testData/cli/jvm/apiVersion.kt:2:5: error: the feature "bound callable references" is only available since API version 1.1
|
||||
""::class.isInstance(42)
|
||||
^
|
||||
compiler/testData/cli/jvm/apiVersion.kt:2:15: error: unresolved reference: isInstance
|
||||
""::class.isInstance(42)
|
||||
^
|
||||
COMPILATION_ERROR
|
||||
COMPILATION_ERROR
|
||||
@@ -0,0 +1,7 @@
|
||||
$TESTDATA_DIR$/apiVersion1.0.kt
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
-language-version
|
||||
1.1
|
||||
-api-version
|
||||
1.0
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
typealias Foo = Int
|
||||
|
||||
sealed class A
|
||||
data class B(val foo: Int): A()
|
||||
|
||||
inline val f get() = ""
|
||||
|
||||
suspend fun test() {
|
||||
""::class
|
||||
""::toString
|
||||
|
||||
Foo::class
|
||||
Foo::toString
|
||||
|
||||
val b by lazy { "" }
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
compiler/testData/cli/jvm/apiVersion1.0.kt:8:1: error: the feature "coroutines" is only available since API version 1.1 (see: https://kotlinlang.org/docs/diagnostics/experimental-coroutines)
|
||||
suspend fun test() {
|
||||
^
|
||||
compiler/testData/cli/jvm/apiVersion1.0.kt:9:5: error: the feature "bound callable references" is only available since API version 1.1
|
||||
""::class
|
||||
^
|
||||
compiler/testData/cli/jvm/apiVersion1.0.kt:10:5: error: the feature "bound callable references" is only available since API version 1.1
|
||||
""::toString
|
||||
^
|
||||
compiler/testData/cli/jvm/apiVersion1.0.kt:15:11: error: the feature "local delegated properties" is only available since API version 1.1
|
||||
val b by lazy { "" }
|
||||
^
|
||||
COMPILATION_ERROR
|
||||
@@ -1,4 +1,7 @@
|
||||
compiler/testData/cli/jvm/apiVersion.kt:2:5: error: the feature "bound callable references" is only available since API version 1.1
|
||||
""::class.isInstance(42)
|
||||
^
|
||||
compiler/testData/cli/jvm/apiVersion.kt:2:15: error: unresolved reference: isInstance
|
||||
""::class.isInstance(42)
|
||||
^
|
||||
COMPILATION_ERROR
|
||||
COMPILATION_ERROR
|
||||
+1
@@ -0,0 +1 @@
|
||||
suspend fun simple() = 5
|
||||
@@ -0,0 +1,4 @@
|
||||
$TESTDATA_DIR$/coroutines.kt
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
-Xcoroutines=enable
|
||||
@@ -0,0 +1 @@
|
||||
OK
|
||||
@@ -0,0 +1,4 @@
|
||||
$TESTDATA_DIR$/coroutines.kt
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
-Xcoroutines=error
|
||||
@@ -0,0 +1,4 @@
|
||||
compiler/testData/cli/jvm/coroutines.kt:1:1: error: the feature "coroutines" is experimental and disabled (see: https://kotlinlang.org/docs/diagnostics/experimental-coroutines)
|
||||
suspend fun simple() = 5
|
||||
^
|
||||
COMPILATION_ERROR
|
||||
@@ -0,0 +1,4 @@
|
||||
$TESTDATA_DIR$/coroutines.kt
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
-Xcoroutines=warn
|
||||
@@ -0,0 +1,4 @@
|
||||
compiler/testData/cli/jvm/coroutines.kt:1:1: warning: the feature "coroutines" is experimental (see: https://kotlinlang.org/docs/diagnostics/experimental-coroutines)
|
||||
suspend fun simple() = 5
|
||||
^
|
||||
OK
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
compiler/testData/cli/jvm/languageVersion.kt:5:17: error: this type is sealed, so it can be inherited by only its own nested classes or objects
|
||||
class Derived : Base()
|
||||
^
|
||||
compiler/testData/cli/jvm/languageVersion.kt:8:5: error: the feature is only available since Kotlin 1.1: bound callable references
|
||||
compiler/testData/cli/jvm/languageVersion.kt:8:5: error: the feature "bound callable references" is only available since language version 1.1
|
||||
""::class.isInstance(42)
|
||||
^
|
||||
compiler/testData/cli/jvm/languageVersion.kt:8:15: error: unresolved reference: isInstance
|
||||
""::class.isInstance(42)
|
||||
^
|
||||
COMPILATION_ERROR
|
||||
COMPILATION_ERROR
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
compiler/testData/cli/jvm/unsupportedTypeAlias.kt:3:1: error: the feature is only available since Kotlin 1.1: type aliases
|
||||
compiler/testData/cli/jvm/unsupportedTypeAlias.kt:3:1: error: the feature "type aliases" is only available since language version 1.1
|
||||
typealias Unused = String
|
||||
^
|
||||
COMPILATION_ERROR
|
||||
Reference in New Issue
Block a user