FIR LC: add tests about type approximation in PsiType provider

This commit is contained in:
Jinseong Jeon
2021-10-07 22:01:55 -07:00
committed by Roman Golyshev
parent c441980c74
commit 9ed2c9d371
17 changed files with 165 additions and 0 deletions
@@ -0,0 +1,3 @@
fun f<caret>oo() = object : Runnable {
override fun run() {}
}
@@ -0,0 +1,2 @@
KtType: java.lang.Runnable
PsiType: PsiType:Runnable
@@ -0,0 +1,6 @@
fun f<caret>oo(): Runnable {
class Local : Runnable {
override fun run() {}
}
return Local()
}
@@ -0,0 +1,2 @@
KtType: java.lang.Runnable
PsiType: PsiType:Runnable
@@ -0,0 +1,8 @@
private fun f<caret>oo() = run {
class Local {
fun bar(): Local {
return this
}
}
val p = Local().bar()
}
@@ -0,0 +1,2 @@
KtType: kotlin.Unit
PsiType: PsiType:Unit
@@ -0,0 +1,5 @@
fun foo() {
class Local {
}
fun b<caret>ar() = Local()
}
@@ -0,0 +1,2 @@
KtType: Local
PsiType: PsiType:Object
@@ -0,0 +1,8 @@
fun foo() = run {
class Local {
fun bar(): Local {
return this
}
}
val p<caret> = Local().bar()
}
@@ -0,0 +1,2 @@
KtType: Local
PsiType: PsiType:Object
@@ -0,0 +1,7 @@
fun foo() {
class Local {
}
val a<caret> = fun (): Local {
return Local()
}
}
@@ -0,0 +1,2 @@
KtType: () -> Local
PsiType: PsiType:Function0<? extends Object>
@@ -0,0 +1,8 @@
fun foo() {
class Local {
fun b<caret>ar(): Local {
return this
}
}
val a = Local().bar()
}
@@ -0,0 +1,2 @@
KtType: Local
PsiType: PsiType:Object