[LL FIR] FileStructure: process super class calls correctly

^KT-56543
^KT-57793
This commit is contained in:
Dmitrii Gridin
2023-04-04 20:13:41 +02:00
committed by Space Team
parent d0e801054c
commit 26f8147a8c
22 changed files with 326 additions and 2 deletions
@@ -0,0 +1,6 @@
// LOOK_UP_FOR_ELEMENT_OF_TYPE: org.jetbrains.kotlin.psi.KtSimpleNameExpression
class A(
val i: () -> Unit = {
fun foo() = B.<expr>prop</expr>.toString()
}
)
@@ -0,0 +1,6 @@
KT element: KtNameReferenceExpression
FIR element: FirErrorNamedReferenceImpl
FIR source kind: KtRealSourceElementKind
FIR element rendered:
<Unresolved name: prop>#
@@ -0,0 +1,12 @@
// LOOK_UP_FOR_ELEMENT_OF_TYPE: org.jetbrains.kotlin.psi.KtSimpleNameExpression
open class A(init: A.() -> Unit) {
val prop: String = ""
}
object B : A({})
object C : A(
{
fun foo() = B.<expr>prop</expr>.toString()
}
)
@@ -0,0 +1,6 @@
KT element: KtNameReferenceExpression
FIR element: FirResolvedNamedReferenceImpl
FIR source kind: KtRealSourceElementKind
FIR element rendered:
R|/A.prop|
@@ -0,0 +1,12 @@
// LOOK_UP_FOR_ELEMENT_OF_TYPE: org.jetbrains.kotlin.psi.KtCallExpression
open class A(init: A.() -> Unit) {
val prop: String = ""
}
object B : A({})
object C : A(
{
fun foo() = B.prop.<expr>toString()</expr>
}
)
@@ -0,0 +1,6 @@
KT element: KtCallExpression
FIR element: FirFunctionCallImpl
FIR source kind: KtRealSourceElementKind
FIR element rendered:
Q|B|.R|/A.prop|.R|kotlin/String.toString|()
@@ -0,0 +1,14 @@
// LOOK_UP_FOR_ELEMENT_OF_TYPE: org.jetbrains.kotlin.psi.KtSimpleNameExpression
open class A(init: A.() -> Unit) {
val prop: String = ""
}
object B : A({})
object C : A(
{
fun foo() = B.<expr>prop</expr>.toString()
}
) {
constructor()
}
@@ -0,0 +1,11 @@
KT element: KtNameReferenceExpression
FIR element: FirRegularClassImpl
FIR source kind: KtRealSourceElementKind
FIR element rendered:
public final [ResolvedTo(BODY_RESOLVE)] object C : R|A| {
public [ResolvedTo(BODY_RESOLVE)] constructor(): R|C| {
super<R|A|>()
}
}
@@ -0,0 +1,20 @@
// LOOK_UP_FOR_ELEMENT_OF_TYPE: org.jetbrains.kotlin.psi.KtSimpleNameExpression
open class A(init: A.() -> Unit) {
val prop: String = ""
}
object B : A({})
object C : A({})
class G : A(
{
fun foo() = B.<expr>prop</expr>.toString()
}
) {
constructor() : super(
{
fun foo() = C.prop.toString()
}
)
}
@@ -0,0 +1,17 @@
KT element: KtNameReferenceExpression
FIR element: FirRegularClassImpl
FIR source kind: KtRealSourceElementKind
FIR element rendered:
public final [ResolvedTo(BODY_RESOLVE)] class G : R|A| {
public [ResolvedTo(BODY_RESOLVE)] constructor(): R|G| {
super<R|A|>([ResolvedTo(RAW_FIR)] fun R|A|.<anonymous>(): R|kotlin/Unit| <inline=Unknown> {
local final [ResolvedTo(RAW_FIR)] fun foo(): R|kotlin/String| {
^foo Q|C|.R|/A.prop|.R|kotlin/String.toString|()
}
}
)
}
}
@@ -0,0 +1,20 @@
// LOOK_UP_FOR_ELEMENT_OF_TYPE: org.jetbrains.kotlin.psi.KtSimpleNameExpression
open class A(init: A.() -> Unit) {
val prop: String = ""
}
object B : A({})
object C : A({})
class G : A(
{
fun foo() = B.prop.toString()
}
) {
constructor() : super(
{
fun foo() = C.<expr>prop</expr>.toString()
}
)
}
@@ -0,0 +1,6 @@
KT element: KtNameReferenceExpression
FIR element: FirResolvedNamedReferenceImpl
FIR source kind: KtRealSourceElementKind
FIR element rendered:
R|/A.prop|