Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolve/objectInnerClass.txt
T
Denis Zharkov 0ef1628751 FIR: Refactor scope structure on body resolve stage
Before this change:
- Local scopes, implicit receivers and type parameter scopes were separated.
- Static scopes for super classes were not present as a concept.
Instead of them, all-inherited-static for the current class has been used.
- During call resolution we were processing implicit receivers first and then non-local scopes,
while we should process them in the order of their syntax appearance from the closest
to the most distant

All these facts affect semantics (see test data changed here and the following commits)

The architecture changes are the following:
- FirTowerDataElement introduced as tower level that is used in resolution
  (effectively it's a union type between scope and implicit receiver + isLocal flag)
- FirTowerDataContext introduced for sake of encapsulation of tower data elements' list
  (it also has redundant implicitReceiverStack and localScopes)
- For each regular class we collect relevant tower data elements and add them to the current context
- Also, we preserve a special tower data context for static entities of the class
  (it doesn't have class' dispatch receiver and generic parameters)
2020-05-15 16:04:44 +03:00

214 lines
8.3 KiB
Plaintext
Vendored

FILE: objectInnerClass.kt
public final val case1: R|anonymous| = object : R|A| {
private constructor(): R|anonymous| {
super<R|kotlin/Any|>()
}
local final inner class Child : R|<anonymous>.Base| {
public[local] constructor(property: R|B|): R|<anonymous>.Child| {
this@R|/anonymous|.super<R|<anonymous>.Base|>(R|<local>/property|)
}
public[local] final fun R|<anonymous>.Base|.zoo(): R|kotlin/Unit| {
lval x: R|B| = this@R|/<anonymous>.Child.zoo|.R|/<anonymous>.Base.property|
}
public[local] final fun foo(): R|kotlin/Unit| {
this@R|/<anonymous>.Child|.R|/<anonymous>.Base.baseFun|()
lval x: R|B| = this@R|/<anonymous>.Child|.R|/<anonymous>.Base.property|
(this@R|/<anonymous>.Child|, this@R|/<anonymous>.Child|).R|/<anonymous>.Child.zoo|()
(this@R|/anonymous|, this@R|/<anonymous>.Child|).R|/anonymous.hoo|()
}
}
public[local] final fun R|<anonymous>.Child|.voo(): R|kotlin/Unit| {
lval x: R|B| = this@R|/anonymous.voo|.R|/<anonymous>.Base.property|
}
public[local] final fun R|<anonymous>.Base|.hoo(): R|kotlin/Unit| {
lval x: R|B| = this@R|/anonymous.hoo|.R|/<anonymous>.Base.property|
}
local open inner class Base : R|kotlin/Any| {
public[local] constructor(property: R|B|): R|<anonymous>.Base| {
super<R|kotlin/Any|>()
}
public[local] final val property: R|B| = R|<local>/property|
public get(): R|B|
public[local] final fun baseFun(): R|kotlin/Unit| {
}
}
public[local] final fun caseForBase(): R|kotlin/Unit| {
lval base: R|<anonymous>.Base| = this@R|/anonymous|.R|/<anonymous>.Base.Base|(R|/B.B|())
R|<local>/base|.R|/<anonymous>.Base.baseFun|()
R|<local>/base|.R|/<anonymous>.Base.property|
(this@R|/anonymous|, R|<local>/base|).R|/anonymous.hoo|()
}
public[local] final fun caseForChild(): R|kotlin/Unit| {
lval child: R|<anonymous>.Child| = this@R|/anonymous|.R|/<anonymous>.Child.Child|(R|/B.B|())
R|<local>/child|.R|/<anonymous>.Base.baseFun|()
R|<local>/child|.R|/<anonymous>.Base.property|
R|<local>/child|.R|/<anonymous>.Child.foo|()
(this@R|/anonymous|, R|<local>/child|).R|/anonymous.hoo|()
(this@R|/anonymous|, R|<local>/child|).R|/anonymous.voo|()
}
}
public get(): R|anonymous|
public final class Case2 : R|kotlin/Any| {
public constructor(): R|Case2| {
super<R|kotlin/Any|>()
}
public final val x: R|anonymous| = object : R|Case2.Base| {
private constructor(): R|anonymous| {
this@R|/Case2|.super<R|Case2.Base|>(R|/B.B|())
}
public[local] final fun R|Case2.Base|.zoo(): R|kotlin/Unit| {
lval x: R|B| = this@R|/anonymous.zoo|.R|/Case2.Base.property|
}
public[local] final fun foo(): R|kotlin/Unit| {
this@R|/anonymous|.R|/Case2.Base.baseFun|()
lval x: R|B| = this@R|/anonymous|.R|/Case2.Base.property|
(this@R|/anonymous|, this@R|/anonymous|).R|/anonymous.zoo|()
(this@R|/Case2|, this@R|/anonymous|).R|/Case2.hoo|()
}
}
public get(): R|anonymous|
public final fun R|Case2.Base|.hoo(): R|kotlin/Unit| {
lval x: R|B| = this@R|/Case2.hoo|.R|/Case2.Base.property|
}
public open inner class Base : R|kotlin/Any| {
public constructor(property: R|B|): R|Case2.Base| {
super<R|kotlin/Any|>()
}
public final val property: R|B| = R|<local>/property|
public get(): R|B|
public final fun baseFun(): R|kotlin/Unit| {
}
}
public final fun caseForBase(): R|kotlin/Unit| {
lval base: R|Case2.Base| = this@R|/Case2|.R|/Case2.Base.Base|(R|/B.B|())
R|<local>/base|.R|/Case2.Base.baseFun|()
R|<local>/base|.R|/Case2.Base.property|
(this@R|/Case2|, R|<local>/base|).R|/Case2.hoo|()
}
public final fun caseForChild(): R|kotlin/Unit| {
lval child: R|anonymous| = this@R|/Case2|.R|/Case2.x|
R|<local>/child|.R|/Case2.Base.baseFun|()
R|<local>/child|.R|/Case2.Base.property|
(this@R|/Case2|, R|<local>/child|).R|/Case2.hoo|()
}
}
public final class Case3 : R|kotlin/Any| {
public constructor(): R|Case3| {
super<R|kotlin/Any|>()
}
public final val x: R|anonymous| = object : R|A| {
private constructor(): R|anonymous| {
super<R|kotlin/Any|>()
}
local final inner class Child : R|Case3.<anonymous>.Base| {
public[local] constructor(property: R|B|): R|Case3.<anonymous>.Child| {
this@R|/anonymous|.super<R|Case3.<anonymous>.Base|>(R|<local>/property|)
}
public[local] final fun R|Case3.<anonymous>.Base|.zoo(): R|kotlin/Unit| {
lval x: R|B| = this@R|/Case3.<anonymous>.Child.zoo|.R|/Case3.<anonymous>.Base.property|
}
public[local] final fun foo(): R|kotlin/Unit| {
this@R|/Case3.<anonymous>.Child|.R|/Case3.<anonymous>.Base.baseFun|()
lval x: R|B| = this@R|/Case3.<anonymous>.Child|.R|/Case3.<anonymous>.Base.property|
(this@R|/Case3.<anonymous>.Child|, this@R|/Case3.<anonymous>.Child|).R|/Case3.<anonymous>.Child.zoo|()
(this@R|/anonymous|, this@R|/Case3.<anonymous>.Child|).R|/anonymous.hoo|()
}
}
public[local] final fun R|Case3.<anonymous>.Child|.voo(): R|kotlin/Unit| {
lval x: R|B| = this@R|/anonymous.voo|.R|/Case3.<anonymous>.Base.property|
}
public[local] final fun R|Case3.<anonymous>.Base|.hoo(): R|kotlin/Unit| {
lval x: R|B| = this@R|/anonymous.hoo|.R|/Case3.<anonymous>.Base.property|
}
local open inner class Base : R|kotlin/Any| {
public[local] constructor(property: R|B|): R|Case3.<anonymous>.Base| {
super<R|kotlin/Any|>()
}
public[local] final val property: R|B| = R|<local>/property|
public get(): R|B|
public[local] final fun baseFun(): R|kotlin/Unit| {
}
}
public[local] final fun caseForBase(): R|kotlin/Unit| {
lval base: R|Case3.<anonymous>.Base| = this@R|/anonymous|.R|/Case3.<anonymous>.Base.Base|(R|/B.B|())
R|<local>/base|.R|/Case3.<anonymous>.Base.baseFun|()
R|<local>/base|.R|/Case3.<anonymous>.Base.property|
(this@R|/anonymous|, R|<local>/base|).R|/anonymous.hoo|()
}
public[local] final fun caseForChild(): R|kotlin/Unit| {
lval child: R|Case3.<anonymous>.Child| = this@R|/anonymous|.R|/Case3.<anonymous>.Child.Child|(R|/B.B|())
R|<local>/child|.R|/Case3.<anonymous>.Base.baseFun|()
R|<local>/child|.R|/Case3.<anonymous>.Base.property|
R|<local>/child|.R|/Case3.<anonymous>.Child.foo|()
(this@R|/anonymous|, R|<local>/child|).R|/anonymous.hoo|()
(this@R|/anonymous|, R|<local>/child|).R|/anonymous.voo|()
}
}
public get(): R|anonymous|
}
public abstract interface A : R|kotlin/Any| {
}
public final class B : R|kotlin/Any| {
public constructor(): R|B| {
super<R|kotlin/Any|>()
}
}
FILE: CHECK_TYPE.kt
public final fun <T> checkSubtype(t: R|T|): R|T| {
^checkSubtype R|<local>/t|
}
public final class Inv<T> : R|kotlin/Any| {
public constructor<T>(): R|tests/_checkType/Inv<T>| {
super<R|kotlin/Any|>()
}
}
public final fun <E> R|tests/_checkType/Inv<E>|._(): R|kotlin/Unit| {
}
public final infix fun <T> R|T|.checkType(f: R|tests/_checkType/Inv<T>.() -> kotlin/Unit|): R|kotlin/Unit| {
}