FIR IDE: add APIs about FunctionClassKind

This commit is contained in:
Jinseong Jeon
2021-11-03 16:26:12 -07:00
committed by Ilya Kirillov
parent d029e84b96
commit 6d150fb7a5
16 changed files with 202 additions and 1 deletions
@@ -0,0 +1,7 @@
fun <T, R> foo(p: T, mapper : (T) -> R): R {
mapper(p)
}
fun bar() {
foo(1, x<caret>y)
}
@@ -0,0 +1,3 @@
expression: xy
expected type: (T) -> R
functionClassKind: Function
@@ -0,0 +1,11 @@
// WITH_REFLECT
import kotlin.reflect.KFunction1
fun <T, R> foo(p: T, mapper : (T) -> R): R {
mapper(p)
}
fun bar() {
foo(1, x<caret>y as KFunction1<Int, String>)
}
@@ -0,0 +1,3 @@
expression: xy
expected type: (kotlin.Int) -> kotlin.String
functionClassKind: KFunction
@@ -0,0 +1,11 @@
// WITH_REFLECT
import kotlin.reflect.KSuspendFunction0
fun foo(pause : suspend () -> Unit) {
pause()
}
fun bar() {
foo(x<caret>y as KSuspendFunction0<Unit>)
}
@@ -0,0 +1,3 @@
expression: xy
expected type: suspend () -> kotlin.Unit
functionClassKind: KSuspendFunction
@@ -0,0 +1,7 @@
fun foo(pause : suspend () -> Unit) {
pause()
}
fun bar() {
foo(x<caret>y)
}
@@ -0,0 +1,3 @@
expression: xy
expected type: suspend () -> kotlin.Unit
functionClassKind: SuspendFunction