Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolve/innerClasses/inner.fir.txt
T
Roman Golyshev 9b9c51bc8d [FIR] Fix dispatch receivers on inner classes' constructors
1. Inner class constructor should have its outer class as a dispatch
receiver, since it is necessary for the call. Before it was null
2. Substituted inner class constructor should have its original dispatch
 receiver type with the proper substitution. Before it was set to the
 class itself (since the class was usually passed as a new dispatch
 receiver)

Also, modify FIR renderer, so it properly renders the dispatch receiver
of the constructors
2021-10-05 12:17:08 +00:00

49 lines
1.6 KiB
Plaintext
Vendored

FILE: inner.kt
public final class Owner : R|kotlin/Any| {
public constructor(): R|Owner| {
super<R|kotlin/Any|>()
}
public final fun foo(): R|kotlin/Unit| {
this@R|/Owner|.R|/Owner.bar|()
this@R|/Owner|.R|/Owner.bar|()
}
public final fun bar(): R|kotlin/Unit| {
lval i: R|Owner.Inner| = this@R|/Owner|.R|/Owner.Inner.Inner|()
R|<local>/i|.R|/Owner.Inner.baz|()
}
public final fun err(): R|kotlin/Unit| {
}
public final inner class Inner : R|kotlin/Any| {
public Owner.constructor(): R|Owner.Inner| {
super<R|kotlin/Any|>()
}
public final fun baz(): R|kotlin/Unit| {
this@R|/Owner.Inner|.R|/Owner.Inner.gau|()
this@R|/Owner.Inner|.R|/Owner.Inner.gau|()
}
public final fun gau(): R|kotlin/Unit| {
lval o: R|Owner| = R|/Owner.Owner|()
R|<local>/o|.R|/Owner.foo|()
this@R|/Owner|.R|/Owner.foo|()
this@R|/Owner|.R|/Owner.foo|()
this@R|/Owner.Inner|.<Unresolved name: err>#()
}
}
}
public final fun test(): R|kotlin/Unit| {
lval o: R|Owner| = R|/Owner.Owner|()
R|<local>/o|.R|/Owner.foo|()
lval err: <ERROR TYPE REF: Resolution to classifier> = Q|Owner|.<Resolution to classifier>#()
R|<local>/err|.<Unresolved name: baz>#()
lval i: R|Owner.Inner| = R|<local>/o|.R|/Owner.Inner.Inner|()
R|<local>/i|.R|/Owner.Inner.gau|()
}