Report error on typeOf<suspend ...>()
Otherwise an invalid type is constructed which causes kotlin-reflect to crash, and stdlib implementation to render the type incorrectly. The reason is that suspend functional types are not properly supported in reflection. Once they are supported, this error can be removed. #KT-47562
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
// WITH_RUNTIME
|
||||
// USE_EXPERIMENTAL: kotlin.ExperimentalStdlibApi
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
inline fun <reified X> f() = g<List<X>>()
|
||||
inline fun <reified Y> g() = typeOf<Y>()
|
||||
|
||||
fun test() {
|
||||
<!TYPEOF_SUSPEND_TYPE!>typeOf<suspend () -> Int>()<!>
|
||||
<!TYPEOF_SUSPEND_TYPE!>f<suspend (String) -> Unit>()<!>
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package
|
||||
|
||||
public inline fun </*0*/ reified X> f(): kotlin.reflect.KType
|
||||
public inline fun </*0*/ reified Y> g(): kotlin.reflect.KType
|
||||
public fun test(): kotlin.Unit
|
||||
Reference in New Issue
Block a user