Deserialize constructors and properties with version requirement 1.3

if they have suspend function type in their descriptors.
Also, review fixes.

 #KT-25256: Fixed
This commit is contained in:
Ilmir Usmanov
2018-07-10 18:55:09 +03:00
parent c460593b7d
commit 6ba2baa9da
24 changed files with 234 additions and 136 deletions
@@ -27,6 +27,6 @@ fun ok(continuation: Continuation<String>): Any? {
fun box(): String {
if ((::ok).builder() != "OK") return "FAIL 1"
if (({ cont: Continuation<String> -> "OK" }).builder() != "OK") return "FAIL 2"
if ((fun (cont: Continuation<String>): Any? = "OK").builder() != "OK") return "FAIL 2"
if ((fun (cont: Continuation<String>): Any? = "OK").builder() != "OK") return "FAIL 3"
return "OK"
}
@@ -7,6 +7,23 @@ suspend fun String.dummy() = this + "K"
suspend fun String.dummy(s: String) = this + s
class C {
suspend fun dummy() = "OK"
}
class WithNested {
class Nested {
suspend fun dummy() = "OK"
}
}
class WithInner {
inner class Inner {
suspend fun dummy() = "OK"
}
}
// FILE: B.kt
// LANGUAGE_VERSION: 1.3
import kotlin.coroutines.experimental.*
@@ -23,5 +40,8 @@ fun box(): String {
if (dummy(continuation) != "OK") return "FAIL 1"
if ("O".dummy(continuation) != "OK") return "FAIL 2"
if ("O".dummy("K", continuation) != "OK") return "FAIL 3"
if (C().dummy(continuation) != "OK") return "FAIL 4"
if (WithNested.Nested().dummy(continuation) != "OK") return "FAIL 5"
if (WithInner().Inner().dummy(continuation) != "OK") return "FAIL 6"
return "OK"
}