Build member scope for FirAnonymousObject correctly

This commit is contained in:
Mikhail Glukhikh
2019-10-28 15:45:28 +03:00
parent e1c889e871
commit 7dee1cd9d2
19 changed files with 114 additions and 76 deletions
@@ -360,7 +360,8 @@ class Fir2IrDeclarationStorage(
val containerSource = function.containerSource
val descriptor = containerSource?.let { WrappedFunctionDescriptorWithContainerSource(it) } ?: WrappedSimpleFunctionDescriptor()
return function.convertWithOffsets { startOffset, endOffset ->
irSymbolTable.declareSimpleFunction(startOffset, endOffset, origin, descriptor) { symbol ->
enterScope(descriptor)
val result = irSymbolTable.declareSimpleFunction(startOffset, endOffset, origin, descriptor) { symbol ->
IrFunctionImpl(
startOffset, endOffset, origin, symbol,
function.name, function.visibility, function.modality!!,
@@ -372,6 +373,8 @@ class Fir2IrDeclarationStorage(
isExpect = function.isExpect
)
}
leaveScope(descriptor)
result
}.bindAndDeclareParameters(function, descriptor, irParent, isStatic = function.isStatic, shouldLeaveScope = shouldLeaveScope)
}
@@ -486,7 +489,8 @@ class Fir2IrDeclarationStorage(
val containerSource = property.containerSource
val descriptor = containerSource?.let { WrappedPropertyDescriptorWithContainerSource(it) } ?: WrappedPropertyDescriptor()
property.convertWithOffsets { startOffset, endOffset ->
irSymbolTable.declareProperty(
enterScope(descriptor)
val result = irSymbolTable.declareProperty(
startOffset, endOffset,
origin, descriptor, property.delegate != null
) { symbol ->
@@ -525,6 +529,8 @@ class Fir2IrDeclarationStorage(
}
}
}
leaveScope(descriptor)
result
}
}
}
@@ -526,6 +526,7 @@ class Fir2IrVisitor(
property: FirProperty,
firOverriddenSymbol: FirPropertySymbol? = null
): IrProperty {
declarationStorage.enterScope(descriptor)
val initializer = property.initializer
val delegate = property.delegate
val irParent = this.parent
@@ -572,6 +573,7 @@ class Fir2IrVisitor(
property.annotations.forEach {
annotations += it.accept(this@Fir2IrVisitor, null) as IrConstructorCall
}
declarationStorage.leaveScope(descriptor)
return this
}
@@ -14,8 +14,8 @@ import org.jetbrains.kotlin.fir.types.ConeKotlinType
import org.jetbrains.kotlin.name.Name
interface ImplicitReceiverStack {
fun add(name: Name, value: ImplicitReceiverValue<*>)
fun pop(name: Name)
fun add(name: Name?, value: ImplicitReceiverValue<*>)
fun pop(name: Name?)
operator fun get(name: String?): ImplicitReceiverValue<*>?
@@ -31,17 +31,21 @@ class ImplicitReceiverStackImpl : ImplicitReceiverStack, Iterable<ImplicitReceiv
private val indexesPerSymbol: MutableMap<FirBasedSymbol<*>, Int> = mutableMapOf()
val size: Int get() = stack.size
override fun add(name: Name, value: ImplicitReceiverValue<*>) {
override fun add(name: Name?, value: ImplicitReceiverValue<*>) {
stack += value
originalTypes += value.type
val index = stack.size - 1
indexesPerLabel.put(name, index)
if (name != null) {
indexesPerLabel.put(name, index)
}
indexesPerSymbol.put(value.boundSymbol, index)
}
override fun pop(name: Name) {
override fun pop(name: Name?) {
val index = stack.size - 1
indexesPerLabel.remove(name, index)
if (name != null) {
indexesPerLabel.remove(name, index)
}
originalTypes.removeAt(index)
val value = stack.removeAt(index)
indexesPerSymbol.remove(value.boundSymbol)
@@ -6,6 +6,8 @@
package org.jetbrains.kotlin.fir.resolve
import org.jetbrains.kotlin.fir.FirSession
import org.jetbrains.kotlin.fir.declarations.FirAnonymousObject
import org.jetbrains.kotlin.fir.declarations.FirClass
import org.jetbrains.kotlin.fir.declarations.FirRegularClass
import org.jetbrains.kotlin.fir.scopes.FirScope
import org.jetbrains.kotlin.fir.scopes.impl.FirCompositeScope
@@ -18,8 +20,8 @@ fun ConeKotlinType.scope(useSiteSession: FirSession, scopeSession: ScopeSession)
is ConeKotlinErrorType -> null
is ConeAbbreviatedType -> directExpansionType(useSiteSession)?.scope(useSiteSession, scopeSession)
is ConeClassLikeType -> {
// TODO: for ConeClassLikeType they might be a type alias instead of a regular class
val fir = this.lookupTag.toSymbol(useSiteSession)?.fir as? FirRegularClass ?: return null
// TODO: for ConeClassLikeType they might be a type alias instead of a class
val fir = this.lookupTag.toSymbol(useSiteSession)?.fir as? FirClass<*> ?: return null
wrapSubstitutionScopeIfNeed(useSiteSession, fir.buildUseSiteMemberScope(useSiteSession, scopeSession)!!, fir, scopeSession)
}
is ConeTypeParameterType -> {
@@ -53,3 +55,11 @@ fun FirRegularClass.defaultType(): ConeClassTypeImpl {
isNullable = false
)
}
fun FirAnonymousObject.defaultType(): ConeClassTypeImpl {
return ConeClassTypeImpl(
symbol.toLookupTag(),
emptyArray(),
isNullable = false
)
}
@@ -55,7 +55,7 @@ fun FirClassSymbol<*>.buildUseSiteMemberScope(useSiteSession: FirSession, builde
}
}
fun FirRegularClass.buildUseSiteMemberScope(useSiteSession: FirSession, builder: ScopeSession): FirScope? {
fun FirClass<*>.buildUseSiteMemberScope(useSiteSession: FirSession, builder: ScopeSession): FirScope? {
if (classId.isLocal) {
// It's not possible to find local class by symbol
return buildDefaultUseSiteMemberScope(useSiteSession, builder)
@@ -67,10 +67,9 @@ class ReturnTypeCalculatorWithJump(val session: FirSession, val scopeSession: Sc
classId.outerClassId
}.mapTo(mutableListOf()) { provider.getFirClassifierByFqName(it) }
if (file == null || outerClasses.any { it == null }) return FirErrorTypeRefImpl(
null,
"I don't know what todo"
)
if (file == null || outerClasses.any { it == null }) {
return FirErrorTypeRefImpl(null, "Cannot calculate return type (local class/object?)")
}
declaration.transformReturnTypeRef(
TransformImplicitType,
@@ -150,6 +150,10 @@ open class FirBodyResolveTransformer(
return declarationsTransformer.transformRegularClass(regularClass, data)
}
override fun transformAnonymousObject(anonymousObject: FirAnonymousObject, data: Any?): CompositeTransformResult<FirStatement> {
return declarationsTransformer.transformAnonymousObject(anonymousObject, data)
}
override fun transformSimpleFunction(simpleFunction: FirSimpleFunction, data: Any?): CompositeTransformResult<FirDeclaration> {
return declarationsTransformer.transformSimpleFunction(simpleFunction, data)
}
@@ -151,6 +151,15 @@ class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransformer)
return result as CompositeTransformResult<FirStatement>
}
override fun transformAnonymousObject(anonymousObject: FirAnonymousObject, data: Any?): CompositeTransformResult<FirStatement> {
val type = anonymousObject.defaultType()
anonymousObject.resultType = FirResolvedTypeRefImpl(anonymousObject.source, type)
val result = withLabelAndReceiverType(null, anonymousObject, type) {
transformDeclaration(anonymousObject, data)
}
return result as CompositeTransformResult<FirStatement>
}
private fun transformAnonymousFunctionWithLambdaResolution(
anonymousFunction: FirAnonymousFunction, lambdaResolution: LambdaResolution
): FirAnonymousFunction {
@@ -339,13 +348,13 @@ class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransformer)
}
private inline fun <T> withLabelAndReceiverType(
labelName: Name,
labelName: Name?,
owner: FirDeclaration,
type: ConeKotlinType,
block: () -> T
): T {
val implicitReceiverValue = when (owner) {
is FirRegularClass -> {
is FirClass<*> -> {
ImplicitDispatchReceiverValue(owner.symbol, type, symbolProvider, session, scopeSession)
}
is FirFunction<*> -> {
@@ -1,12 +1,12 @@
FILE: localImplicitBodies.kt
public final fun foo(): R|kotlin/Unit| {
lval x: R|kotlin/Any| = object : R|kotlin/Any| {
lval x: R|anonymous| = object : R|kotlin/Any| {
private constructor(): R|kotlin/Any| {
super<R|kotlin/Any|>()
}
public final fun sss(): <ERROR TYPE REF: Unresolved name: abc> {
^sss <Unresolved name: abc>#()
public final fun sss(): <ERROR TYPE REF: Cannot calculate return type (local class/object?)> {
^sss R?C|/abc|()
}
public final fun abc(): R|kotlin/Int| {
@@ -15,5 +15,5 @@ FILE: localImplicitBodies.kt
}
lval g: <ERROR TYPE REF: Unresolved name: sss> = R|<local>/x|.<Unresolved name: sss>#()
lval g: <ERROR TYPE REF: Cannot calculate return type (local class/object?)> = R|<local>/x|.R?C|/sss|()
}
+4 -4
View File
@@ -8,7 +8,7 @@ FILE: localObject.kt
}
public final fun tesLambda(x: R|kotlin/Int|): R|kotlin/Int| {
^tesLambda R|/run|<R|kotlin/Int|>(<L> = run@fun <anonymous>(): R|kotlin/Int| {
lval obj: R|Foo| = object : R|Foo| {
lval obj: R|anonymous| = object : R|Foo| {
private constructor(): R|kotlin/Any| {
super<R|kotlin/Any|>()
}
@@ -34,7 +34,7 @@ FILE: localObject.kt
public final var x: R|kotlin/Int| = Int(1)
public get(): R|kotlin/Int|
public set(value: R|kotlin/Int|): R|kotlin/Unit| {
lval obj: R|Foo| = object : R|Foo| {
lval obj: R|anonymous| = object : R|Foo| {
private constructor(): R|kotlin/Any| {
super<R|kotlin/Any|>()
}
@@ -50,7 +50,7 @@ FILE: localObject.kt
public final val y: R|kotlin/Int|
public get(): R|kotlin/Int| {
lval obj: R|Foo| = object : R|Foo| {
lval obj: R|anonymous| = object : R|Foo| {
private constructor(): R|kotlin/Any| {
super<R|kotlin/Any|>()
}
@@ -65,7 +65,7 @@ FILE: localObject.kt
}
public final val z: R|kotlin/Int| = R|/run|<R|kotlin/Int|>(<L> = run@fun <anonymous>(): R|kotlin/Int| {
lval obj: R|Foo| = object : R|Foo| {
lval obj: R|anonymous| = object : R|Foo| {
private constructor(): R|kotlin/Any| {
super<R|kotlin/Any|>()
}
+3 -3
View File
@@ -1,7 +1,7 @@
FILE: problems.kt
public final val sb: R|java/lang/StringBuilder| = R|java/lang/StringBuilder.StringBuilder|()
public get(): R|java/lang/StringBuilder|
public final val o: R|kotlin/Any| = object : R|kotlin/Any| {
public final val o: R|anonymous| = object : R|kotlin/Any| {
private constructor(): R|kotlin/Any| {
super<R|kotlin/Any|>()
}
@@ -10,12 +10,12 @@ FILE: problems.kt
public get(): R|kotlin/String|
public final fun test(): R|kotlin/Unit| {
<Unresolved name: name>#
R|/name|
}
}
public get(): R|kotlin/Any|
public get(): R|anonymous|
public final fun test(): R|kotlin/Unit| {
local final class Local : R|kotlin/Any| {
public constructor(): R|Local| {
@@ -61,7 +61,7 @@ fun FirEnumEntryImpl.addDeclaration(declaration: FirDeclaration) {
val FirTypeAlias.expandedConeType: ConeClassLikeType? get() = expandedTypeRef.coneTypeSafe()
val FirRegularClass.classId get() = symbol.classId
val FirClass<*>.classId get() = symbol.classId
val FirClassSymbol<*>.superConeTypes
get() = when (this) {
@@ -17,7 +17,7 @@ FILE fqName:<root> fileName:/objectLiteralExpressions.kt
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
PROPERTY name:test1 visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Any visibility:private [final,static]
FIELD PROPERTY_BACKING_FIELD name:test1 type:<uninitialized parent>.<anonymous> visibility:private [final,static]
EXPRESSION_BODY
BLOCK type=<root>.test1.<no name provided> origin=OBJECT_LITERAL
CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[kotlin.Any]
@@ -27,13 +27,13 @@ FILE fqName:<root> fileName:/objectLiteralExpressions.kt
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[kotlin.Any]'
CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.test1.<no name provided>' type=<root>.test1.<no name provided> origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test1> visibility:public modality:FINAL <> () returnType:kotlin.Any
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test1> visibility:public modality:FINAL <> () returnType:<uninitialized parent>.<anonymous>
correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test1> (): kotlin.Any declared in <root>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Any visibility:private [final,static]' type=kotlin.Any origin=null
RETURN type=kotlin.Nothing from='public final fun <get-test1> (): <uninitialized parent>.<anonymous> declared in <root>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:<uninitialized parent>.<anonymous> visibility:private [final,static]' type=<uninitialized parent>.<anonymous> origin=null
PROPERTY name:test2 visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:test2 type:<root>.IFoo visibility:private [final,static]
FIELD PROPERTY_BACKING_FIELD name:test2 type:<uninitialized parent>.<anonymous> visibility:private [final,static]
EXPRESSION_BODY
BLOCK type=<root>.test2.<no name provided> origin=OBJECT_LITERAL
CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[<root>.IFoo]
@@ -48,11 +48,11 @@ FILE fqName:<root> fileName:/objectLiteralExpressions.kt
CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null
message: CONST String type=kotlin.String value="foo"
CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.test2.<no name provided>' type=<root>.test2.<no name provided> origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test2> visibility:public modality:FINAL <> () returnType:<root>.IFoo
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test2> visibility:public modality:FINAL <> () returnType:<uninitialized parent>.<anonymous>
correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test2> (): <root>.IFoo declared in <root>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:<root>.IFoo visibility:private [final,static]' type=<root>.IFoo origin=null
RETURN type=kotlin.Nothing from='public final fun <get-test2> (): <uninitialized parent>.<anonymous> declared in <root>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:<uninitialized parent>.<anonymous> visibility:private [final,static]' type=<uninitialized parent>.<anonymous> origin=null
CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Outer
CONSTRUCTOR visibility:public <> () returnType:<root>.Outer [primary]
@@ -82,10 +82,10 @@ FILE fqName:<root> fileName:/objectLiteralExpressions.kt
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:test3 visibility:public modality:FINAL <> ($this:<root>.Outer) returnType:<root>.Outer.Inner
FUN name:test3 visibility:public modality:FINAL <> ($this:<root>.Outer) returnType:<uninitialized parent>.<anonymous>
$this: VALUE_PARAMETER name:<this> type:<root>.Outer
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test3 (): <root>.Outer.Inner declared in <root>.Outer'
RETURN type=kotlin.Nothing from='public final fun test3 (): <uninitialized parent>.<anonymous> declared in <root>.Outer'
BLOCK type=<root>.Outer.test3.<no name provided> origin=OBJECT_LITERAL
CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[<root>.Outer.Inner]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Outer.test3.<no name provided>
@@ -112,10 +112,10 @@ FILE fqName:<root> fileName:/objectLiteralExpressions.kt
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:test4 visibility:public modality:FINAL <> ($receiver:<root>.Outer) returnType:<root>.Outer.Inner
FUN name:test4 visibility:public modality:FINAL <> ($receiver:<root>.Outer) returnType:<uninitialized parent>.<anonymous>
$receiver: VALUE_PARAMETER name:<this> type:<root>.Outer
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test4 (): <root>.Outer.Inner declared in <root>'
RETURN type=kotlin.Nothing from='public final fun test4 (): <uninitialized parent>.<anonymous> declared in <root>'
BLOCK type=<root>.test4.<no name provided> origin=OBJECT_LITERAL
CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[<root>.Outer.Inner]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.test4.<no name provided>
@@ -48,10 +48,10 @@ FILE fqName:<root> fileName:/classLiteralInAnnotation.kt
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
FUN name:test2 visibility:public modality:FINAL <T> () returnType:kotlin.Any [inline]
FUN name:test2 visibility:public modality:FINAL <T> () returnType:<uninitialized parent>.<anonymous> [inline]
TYPE_PARAMETER name:T index:0 variance: superTypes:[]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test2 <T> (): kotlin.Any [inline] declared in <root>'
RETURN type=kotlin.Nothing from='public final fun test2 <T> (): <uninitialized parent>.<anonymous> [inline] declared in <root>'
BLOCK type=<root>.test2.<no name provided> origin=OBJECT_LITERAL
CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[kotlin.Any]
annotations:
@@ -63,10 +63,10 @@ FILE fqName:<root> fileName:/classLiteralInAnnotation.kt
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[kotlin.Any]'
CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.test2.<no name provided>' type=<root>.test2.<no name provided> origin=null
PROPERTY name:test3 visibility:public modality:FINAL [var]
FUN name:<get-test3> visibility:public modality:FINAL <> () returnType:kotlin.Any
FUN name:<get-test3> visibility:public modality:FINAL <> () returnType:<uninitialized parent>.<anonymous>
correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [var]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test3> (): kotlin.Any declared in <root>'
RETURN type=kotlin.Nothing from='public final fun <get-test3> (): <uninitialized parent>.<anonymous> declared in <root>'
BLOCK type=<root>.<get-test3>.<no name provided> origin=OBJECT_LITERAL
CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[kotlin.Any]
annotations:
@@ -77,9 +77,9 @@ FILE fqName:<root> fileName:/classLiteralInAnnotation.kt
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[kotlin.Any]'
CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.<get-test3>.<no name provided>' type=<root>.<get-test3>.<no name provided> origin=null
FUN name:<set-test3> visibility:public modality:FINAL <> (v:kotlin.Any) returnType:kotlin.Unit
FUN name:<set-test3> visibility:public modality:FINAL <> (v:<uninitialized parent>.<anonymous>) returnType:kotlin.Unit
correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [var]
VALUE_PARAMETER name:v index:0 type:kotlin.Any
VALUE_PARAMETER name:v index:0 type:<uninitialized parent>.<anonymous>
BLOCK_BODY
BLOCK type=<root>.<set-test3>.<no name provided> origin=OBJECT_LITERAL
CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[kotlin.Any]
@@ -62,7 +62,7 @@ FILE fqName:<root> fileName:/enumEntryReferenceFromEnumEntryClass.kt
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:aLambda type:kotlin.Function0<kotlin.Unit> visibility:private [final]' type=kotlin.Function0<kotlin.Unit> origin=null
receiver: GET_VAR '<this>: <root>.MyEnum.Z declared in <root>.MyEnum.Z.<get-aLambda>' type=<root>.MyEnum.Z origin=null
PROPERTY name:anObject visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:anObject type:kotlin.Any visibility:private [final]
FIELD PROPERTY_BACKING_FIELD name:anObject type:<uninitialized parent>.<anonymous> visibility:private [final]
EXPRESSION_BODY
BLOCK type=<root>.MyEnum.Z.anObject.<no name provided> origin=OBJECT_LITERAL
CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[kotlin.Any]
@@ -87,12 +87,12 @@ FILE fqName:<root> fileName:/enumEntryReferenceFromEnumEntryClass.kt
CALL 'public final fun foo (): kotlin.Unit declared in <root>.MyEnum.Z' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <root>.MyEnum.Z declared in <root>.MyEnum.Z' type=<root>.MyEnum.Z origin=null
CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.MyEnum.Z.anObject.<no name provided>' type=<root>.MyEnum.Z.anObject.<no name provided> origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-anObject> visibility:public modality:FINAL <> ($this:<root>.MyEnum.Z) returnType:kotlin.Any
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-anObject> visibility:public modality:FINAL <> ($this:<root>.MyEnum.Z) returnType:<uninitialized parent>.<anonymous>
correspondingProperty: PROPERTY name:anObject visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.MyEnum.Z
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-anObject> (): kotlin.Any declared in <root>.MyEnum.Z'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:anObject type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null
RETURN type=kotlin.Nothing from='public final fun <get-anObject> (): <uninitialized parent>.<anonymous> declared in <root>.MyEnum.Z'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:anObject type:<uninitialized parent>.<anonymous> visibility:private [final]' type=<uninitialized parent>.<anonymous> origin=null
receiver: GET_VAR '<this>: <root>.MyEnum.Z declared in <root>.MyEnum.Z.<get-anObject>' type=<root>.MyEnum.Z origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
overridden:
@@ -67,31 +67,32 @@ FILE fqName:<root> fileName:/multipleThisReferences.kt
RETURN type=kotlin.Nothing from='public final fun <get-y> (): kotlin.Int declared in <root>.Host'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.Host declared in <root>.Host.<get-y>' type=<root>.Host origin=null
FUN name:test visibility:public modality:FINAL <> ($this:<root>.Host, $receiver:<root>.Outer) returnType:<root>.Outer.Inner
FUN name:test visibility:public modality:FINAL <> ($this:<root>.Host, $receiver:<root>.Outer) returnType:<uninitialized parent>.<anonymous>
$this: VALUE_PARAMETER name:<this> type:<root>.Host
$receiver: VALUE_PARAMETER name:<this> type:<root>.Outer
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test (): <root>.Outer.Inner declared in <root>.Host'
RETURN type=kotlin.Nothing from='public final fun test (): <uninitialized parent>.<anonymous> declared in <root>.Host'
BLOCK type=<root>.Host.test.<no name provided> origin=OBJECT_LITERAL
CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[<root>.Outer.Inner]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Host.test.<no name provided>
CONSTRUCTOR visibility:private <> () returnType:<root>.Outer.Inner [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (x: kotlin.Int) [primary] declared in <root>.Outer.Inner'
x: CONST Int type=<root>.Outer.Inner value=42
x: CONST Int type=<uninitialized parent>.<anonymous> value=42
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[<root>.Outer.Inner]'
PROPERTY name:xx visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:xx type:kotlin.String visibility:private [final]
FIELD PROPERTY_BACKING_FIELD name:xx type:kotlin.Int visibility:private [final]
EXPRESSION_BODY
CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin' type=kotlin.String origin=null
$receiver: ERROR_CALL 'Unresolved reference: <Unresolved name: x>#' type=IrErrorType
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: CALL 'public final fun <get-x> (): kotlin.Int declared in <root>.Outer.Inner' type=kotlin.Int origin=null
$this: GET_VAR '<this>: <root>.Outer.Inner declared in <root>.Outer.Inner' type=<root>.Outer.Inner origin=null
other: GET_VAR 'y: kotlin.Int declared in <root>.Host.<init>' type=kotlin.Int origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-xx> visibility:public modality:FINAL <> ($this:<root>.Host.test.<no name provided>) returnType:kotlin.String
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-xx> visibility:public modality:FINAL <> ($this:<root>.Host.test.<no name provided>) returnType:kotlin.Int
correspondingProperty: PROPERTY name:xx visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.Host.test.<no name provided>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-xx> (): kotlin.String declared in <root>.Host.test.<no name provided>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xx type:kotlin.String visibility:private [final]' type=kotlin.String origin=null
RETURN type=kotlin.Nothing from='public final fun <get-xx> (): kotlin.Int declared in <root>.Host.test.<no name provided>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xx type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.Host.test.<no name provided> declared in <root>.Host.test.<no name provided>.<get-xx>' type=<root>.Host.test.<no name provided> origin=null
CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.Host.test.<no name provided>' type=<root>.Host.test.<no name provided> origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
@@ -109,7 +109,7 @@ FILE fqName:<root> fileName:/objectReference.kt
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:aLambda type:kotlin.Function0<kotlin.Unit> visibility:private [final]' type=kotlin.Function0<kotlin.Unit> origin=null
receiver: GET_VAR '<this>: <root>.Z declared in <root>.Z.<get-aLambda>' type=<root>.Z origin=null
PROPERTY name:anObject visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:anObject type:kotlin.Any visibility:private [final]
FIELD PROPERTY_BACKING_FIELD name:anObject type:<uninitialized parent>.<anonymous> visibility:private [final]
EXPRESSION_BODY
BLOCK type=<root>.Z.anObject.<no name provided> origin=OBJECT_LITERAL
CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[kotlin.Any]
@@ -144,12 +144,12 @@ FILE fqName:<root> fileName:/objectReference.kt
CALL 'public final fun foo (): kotlin.Unit declared in <root>.Z' type=kotlin.Unit origin=null
$this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=<root>.Z
CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.Z.anObject.<no name provided>' type=<root>.Z.anObject.<no name provided> origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-anObject> visibility:public modality:FINAL <> ($this:<root>.Z) returnType:kotlin.Any
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-anObject> visibility:public modality:FINAL <> ($this:<root>.Z) returnType:<uninitialized parent>.<anonymous>
correspondingProperty: PROPERTY name:anObject visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.Z
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-anObject> (): kotlin.Any declared in <root>.Z'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:anObject type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null
RETURN type=kotlin.Nothing from='public final fun <get-anObject> (): <uninitialized parent>.<anonymous> declared in <root>.Z'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:anObject type:<uninitialized parent>.<anonymous> visibility:private [final]' type=<uninitialized parent>.<anonymous> origin=null
receiver: GET_VAR '<this>: <root>.Z declared in <root>.Z.<get-anObject>' type=<root>.Z origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
overridden:
@@ -62,28 +62,31 @@ FILE fqName:<root> fileName:/thisOfGenericOuterClass.kt
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:test visibility:public modality:FINAL <> ($receiver:<root>.Outer<kotlin.Int>) returnType:<root>.Outer.Inner<kotlin.Int>
FUN name:test visibility:public modality:FINAL <> ($receiver:<root>.Outer<kotlin.Int>) returnType:<uninitialized parent>.<anonymous>
$receiver: VALUE_PARAMETER name:<this> type:<root>.Outer<kotlin.Int>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test (): <root>.Outer.Inner<kotlin.Int> declared in <root>'
RETURN type=kotlin.Nothing from='public final fun test (): <uninitialized parent>.<anonymous> declared in <root>'
BLOCK type=<root>.test.<no name provided> origin=OBJECT_LITERAL
CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[<root>.Outer.Inner<kotlin.Int>]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.test.<no name provided>
CONSTRUCTOR visibility:private <> () returnType:<root>.Outer.Inner<kotlin.Int> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (y: kotlin.Int) [primary] declared in <root>.Outer.Inner'
y: CONST Int type=<root>.Outer.Inner<kotlin.Int> value=42
y: CONST Int type=<uninitialized parent>.<anonymous> value=42
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[<root>.Outer.Inner<kotlin.Int>]'
PROPERTY name:xx visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:xx type:IrErrorType visibility:private [final]
FIELD PROPERTY_BACKING_FIELD name:xx type:kotlin.Int visibility:private [final]
EXPRESSION_BODY
ERROR_CALL 'Unresolved reference: <Ambiguity: plus, [kotlin/Int.plus, kotlin/Int.plus, kotlin/Int.plus, kotlin/Int.plus, kotlin/Int.plus, kotlin/Int.plus]>#' type=IrErrorType
ERROR_CALL 'Unresolved reference: <Unresolved name: y>#' type=IrErrorType
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-xx> visibility:public modality:FINAL <> ($this:<root>.test.<no name provided>) returnType:IrErrorType
CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: CALL 'public final fun <get-x> (): kotlin.Int declared in <root>.Outer' type=kotlin.Int origin=null
$this: GET_VAR '<this>: <root>.Outer declared in <root>.Outer' type=<root>.Outer<*> origin=null
other: CALL 'public final fun <get-y> (): kotlin.Int declared in <root>.Outer.Inner' type=kotlin.Int origin=null
$this: GET_VAR '<this>: <root>.Outer.Inner declared in <root>.Outer.Inner' type=<root>.Outer.Inner origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-xx> visibility:public modality:FINAL <> ($this:<root>.test.<no name provided>) returnType:kotlin.Int
correspondingProperty: PROPERTY name:xx visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.test.<no name provided>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-xx> (): IrErrorType declared in <root>.test.<no name provided>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xx type:IrErrorType visibility:private [final]' type=IrErrorType origin=null
RETURN type=kotlin.Nothing from='public final fun <get-xx> (): kotlin.Int declared in <root>.test.<no name provided>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xx type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.test.<no name provided> declared in <root>.test.<no name provided>.<get-xx>' type=<root>.test.<no name provided> origin=null
CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.test.<no name provided>' type=<root>.test.<no name provided> origin=null
@@ -2,17 +2,17 @@ FILE fqName:<root> fileName:/thisReferenceBeforeClassDeclared.kt
FUN name:test visibility:public modality:FINAL <> ($receiver:<root>.WithCompanion) returnType:kotlin.Unit
$receiver: VALUE_PARAMETER name:<this> type:<root>.WithCompanion
BLOCK_BODY
VAR name:test1 type:<root>.WithCompanion [val]
VAR name:test1 type:<uninitialized parent>.<anonymous> [val]
BLOCK type=<root>.test.<no name provided> origin=OBJECT_LITERAL
CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[<root>.WithCompanion]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.test.<no name provided>
CONSTRUCTOR visibility:private <> () returnType:<root>.WithCompanion [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (a: <root>.WithCompanion.Companion) [primary] declared in <root>.WithCompanion'
a: GET_VAR '<this>: <root>.WithCompanion declared in <root>.test' type=<root>.WithCompanion origin=null
a: GET_VAR '<this>: <uninitialized parent>.<anonymous> declared in <no parent>.<anonymous>' type=<uninitialized parent>.<anonymous> origin=null
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[<root>.WithCompanion]'
CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.test.<no name provided>' type=<root>.test.<no name provided> origin=null
VAR name:test2 type:<root>.WithCompanion [val]
VAR name:test2 type:<uninitialized parent>.<anonymous> [val]
BLOCK type=<root>.test.<no name provided> origin=OBJECT_LITERAL
CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[<root>.WithCompanion]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.test.<no name provided>