'SuspendFunction$n' should not be visible in member scopes (should be unresolved).

'SuspendFunction$n' class descriptors are created on demand by KotlinBuiltIns (and cached).
On serialization, types constructed with 'SuspendFunction$n' are written as 'Function$n' with extra flag (SUSPEND_TYPE).
On deserialization, corresponding 'SuspendFunction$n' classes are used.
This commit is contained in:
Dmitry Petrov
2016-12-15 12:34:03 +03:00
committed by Stanislav Erokhin
parent a70ac0160d
commit 80bd916f5d
26 changed files with 511 additions and 133 deletions
@@ -11,7 +11,7 @@ typealias Test4 = <!WRONG_MODIFIER_TARGET!>suspend<!> Action
typealias Test5 = List<suspend () -> Unit>
typealias Test6 = <!WRONG_MODIFIER_TARGET!>suspend<!> List<() -> Unit>
typealias Test7 = <!WRONG_MODIFIER_TARGET!>suspend<!> SAM
typealias Test8 = SuspendFunction0<Unit>
typealias Test8 = <!WRONG_MODIFIER_TARGET!>suspend<!> <!UNRESOLVED_REFERENCE!>SuspendFunction0<!><Unit>
typealias Test9 = suspend (() -> Unit) -> Unit
typealias Test10 = suspend (suspend () -> Unit) -> Unit
typealias Test11 = suspend () -> (suspend () -> Unit)
@@ -17,5 +17,5 @@ public typealias Test4 = Action
public typealias Test5 = kotlin.collections.List<suspend () -> kotlin.Unit>
public typealias Test6 = kotlin.collections.List<() -> kotlin.Unit>
public typealias Test7 = SAM
public typealias Test8 = suspend () -> kotlin.Unit
public typealias Test8 = [ERROR : SuspendFunction0<Unit>]<kotlin.Unit>
public typealias Test9 = suspend (() -> kotlin.Unit) -> kotlin.Unit
@@ -0,0 +1,3 @@
typealias Test1 = <!UNRESOLVED_REFERENCE!>SuspendFunction0<!><Unit>
typealias Test2 = kotlin.<!UNRESOLVED_REFERENCE!>SuspendFunction0<!><Unit>
typealias Test3 = kotlin.coroutines.<!UNRESOLVED_REFERENCE!>SuspendFunction0<!><Unit>
@@ -0,0 +1,5 @@
package
public typealias Test1 = [ERROR : SuspendFunction0<Unit>]<kotlin.Unit>
public typealias Test2 = [ERROR : kotlin.SuspendFunction0<Unit>]<kotlin.Unit>
public typealias Test3 = [ERROR : kotlin.coroutines.SuspendFunction0<Unit>]<kotlin.Unit>
@@ -0,0 +1,7 @@
package test
fun test1(): suspend () -> Unit = null!!
fun test2(): suspend (Int, String) -> Int = null!!
fun test3(): suspend Int.(String) -> Int = null!!
fun test4(): List<suspend () -> Unit> = null!!
fun test5(): suspend (suspend () -> Unit) -> Unit = null!!
@@ -0,0 +1,7 @@
package test
public fun test1(): suspend () -> kotlin.Unit
public fun test2(): suspend (kotlin.Int, kotlin.String) -> kotlin.Int
public fun test3(): suspend kotlin.Int.(kotlin.String) -> kotlin.Int
public fun test4(): kotlin.collections.List<suspend () -> kotlin.Unit>
public fun test5(): suspend (suspend () -> kotlin.Unit) -> kotlin.Unit