[NI] Support callable references to suspend functions
#KT-30658 Fixed
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// !USE_EXPERIMENTAL: kotlin.Experimental
|
||||
|
||||
import kotlin.reflect.KSuspendFunction0
|
||||
import kotlin.reflect.KSuspendFunction1
|
||||
import kotlin.reflect.KFunction0
|
||||
import kotlin.reflect.KFunction1
|
||||
|
||||
fun test0(serialize: KSuspendFunction0<Unit>) {}
|
||||
fun test1(serialize: KSuspendFunction1<Int, Unit>) {}
|
||||
|
||||
suspend fun foo() {}
|
||||
suspend fun bar(x: Int) {}
|
||||
|
||||
fun test() {
|
||||
test0(::foo)
|
||||
test1(<!TYPE_MISMATCH!>::foo<!>)
|
||||
|
||||
test0(<!TYPE_MISMATCH!>::bar<!>)
|
||||
test1(::bar)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package
|
||||
|
||||
public suspend fun bar(/*0*/ x: kotlin.Int): kotlin.Unit
|
||||
public suspend fun foo(): kotlin.Unit
|
||||
public fun test(): kotlin.Unit
|
||||
public fun test0(/*0*/ serialize: kotlin.reflect.KSuspendFunction0<kotlin.Unit>): kotlin.Unit
|
||||
public fun test1(/*0*/ serialize: kotlin.reflect.KSuspendFunction1<kotlin.Int, kotlin.Unit>): kotlin.Unit
|
||||
Reference in New Issue
Block a user