Deserialize experimental coroutines as suspend functions/types
but deprecate them for now. Promote stub version. #KT-25623: Fixed
This commit is contained in:
+27
@@ -0,0 +1,27 @@
|
||||
suspend fun dummy() {}
|
||||
|
||||
class C {
|
||||
suspend fun dummy() = "OK"
|
||||
}
|
||||
|
||||
class WithNested {
|
||||
class Nested {
|
||||
suspend fun dummy() = "OK"
|
||||
}
|
||||
}
|
||||
|
||||
class WithInner {
|
||||
inner class Inner {
|
||||
suspend fun dummy() = "OK"
|
||||
}
|
||||
}
|
||||
|
||||
val c: suspend () -> Unit = {}
|
||||
|
||||
class WithTypeParameter<T: suspend() -> Unit> {}
|
||||
|
||||
fun returnsSuspend() : suspend() -> Unit = {}
|
||||
|
||||
fun builder(c: suspend () -> Unit) {}
|
||||
|
||||
fun <T: suspend () -> Unit> withTypeParameter() = {}
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromRelease/output.txt
Vendored
+29
@@ -0,0 +1,29 @@
|
||||
warning: language version 1.3 is experimental, there are no backwards compatibility guarantees for new language and library features
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromRelease/release.kt:2:5: error: using 'c: suspend () -> Unit' is an error. Experimental coroutine cannot be used with API version 1.3
|
||||
c()
|
||||
^
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromRelease/release.kt:3:5: error: using 'constructor WithTypeParameter<T : suspend () -> Unit>()' is an error. Experimental coroutine cannot be used with API version 1.3
|
||||
WithTypeParameter<suspend () -> Unit>()
|
||||
^
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromRelease/release.kt:4:5: error: using 'returnsSuspend(): suspend () -> Unit' is an error. Experimental coroutine cannot be used with API version 1.3
|
||||
returnsSuspend()
|
||||
^
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromRelease/release.kt:5:5: error: using 'builder(suspend () -> Unit): Unit' is an error. Experimental coroutine cannot be used with API version 1.3
|
||||
builder {}
|
||||
^
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromRelease/release.kt:6:5: error: using 'withTypeParameter(): () -> Unit' is an error. Experimental coroutine cannot be used with API version 1.3
|
||||
withTypeParameter<suspend () -> Unit>()
|
||||
^
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromRelease/release.kt:8:5: error: using 'dummy(): Unit' is an error. Experimental coroutine cannot be used with API version 1.3
|
||||
dummy()
|
||||
^
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromRelease/release.kt:9:9: error: using 'dummy(): String' is an error. Experimental coroutine cannot be used with API version 1.3
|
||||
C().dummy()
|
||||
^
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromRelease/release.kt:10:25: error: using 'dummy(): String' is an error. Experimental coroutine cannot be used with API version 1.3
|
||||
WithNested.Nested().dummy()
|
||||
^
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromRelease/release.kt:11:25: error: using 'dummy(): String' is an error. Experimental coroutine cannot be used with API version 1.3
|
||||
WithInner().Inner().dummy()
|
||||
^
|
||||
COMPILATION_ERROR
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromRelease/release.kt
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
suspend fun callRelease() {
|
||||
c()
|
||||
WithTypeParameter<suspend () -> Unit>()
|
||||
returnsSuspend()
|
||||
builder {}
|
||||
withTypeParameter<suspend () -> Unit>()
|
||||
|
||||
dummy()
|
||||
C().dummy()
|
||||
WithNested.Nested().dummy()
|
||||
WithInner().Inner().dummy()
|
||||
}
|
||||
Reference in New Issue
Block a user