FirEnumEntry: set correct child class name

This commit is contained in:
Mikhail Glukhikh
2019-12-30 17:10:03 +03:00
parent 97670e5036
commit 3671c8489f
3 changed files with 145 additions and 154 deletions
@@ -539,31 +539,33 @@ class DeclarationsConverter(
session, session,
classWrapper.delegatedSelfTypeRef, classWrapper.delegatedSelfTypeRef,
name = enumEntryName, name = enumEntryName,
initializer = FirAnonymousObjectImpl( initializer = withChildClassName(enumEntryName) {
null, FirAnonymousObjectImpl(
session, null,
ClassKind.ENUM_ENTRY, session,
scopeProvider, ClassKind.ENUM_ENTRY,
FirAnonymousObjectSymbol() scopeProvider,
).apply { FirAnonymousObjectSymbol()
annotations += modifiers.annotations ).apply {
val enumClassWrapper = ClassWrapper( annotations += modifiers.annotations
enumEntryName, modifiers, ClassKind.ENUM_ENTRY, hasPrimaryConstructor = true, val enumClassWrapper = ClassWrapper(
hasSecondaryConstructor = classBodyNode.getChildNodesByType(SECONDARY_CONSTRUCTOR).isNotEmpty(), enumEntryName, modifiers, ClassKind.ENUM_ENTRY, hasPrimaryConstructor = true,
delegatedSelfTypeRef = FirResolvedTypeRefImpl( hasSecondaryConstructor = classBodyNode.getChildNodesByType(SECONDARY_CONSTRUCTOR).isNotEmpty(),
null, delegatedSelfTypeRef = FirResolvedTypeRefImpl(
ConeClassLikeTypeImpl( null,
symbol.toLookupTag(), ConeClassLikeTypeImpl(
emptyArray(), symbol.toLookupTag(),
isNullable = false emptyArray(),
) isNullable = false
), )
delegatedSuperTypeRef = classWrapper.delegatedSelfTypeRef, ),
superTypeCallEntry = enumSuperTypeCallEntry delegatedSuperTypeRef = classWrapper.delegatedSelfTypeRef,
) superTypeCallEntry = enumSuperTypeCallEntry
superTypeRefs += enumClassWrapper.delegatedSuperTypeRef )
convertPrimaryConstructor(null, enumClassWrapper)?.let { declarations += it.firConstructor } superTypeRefs += enumClassWrapper.delegatedSuperTypeRef
classBodyNode?.also { declarations += convertClassBody(it, enumClassWrapper) } convertPrimaryConstructor(null, enumClassWrapper)?.let { declarations += it.firConstructor }
classBodyNode?.also { declarations += convertClassBody(it, enumClassWrapper) }
}
}, },
symbol = FirVariableSymbol(CallableId(context.currentClassId, enumEntryName)), symbol = FirVariableSymbol(CallableId(context.currentClassId, enumEntryName)),
status = FirDeclarationStatusImpl(Visibilities.PUBLIC, Modality.FINAL).apply { status = FirDeclarationStatusImpl(Visibilities.PUBLIC, Modality.FINAL).apply {
@@ -479,48 +479,49 @@ class RawFirBuilder(session: FirSession, val scopeProvider: FirScopeProvider, va
} }
private fun KtEnumEntry.toFirEnumEntry(delegatedEnumSelfTypeRef: FirResolvedTypeRef): FirDeclaration { private fun KtEnumEntry.toFirEnumEntry(delegatedEnumSelfTypeRef: FirResolvedTypeRef): FirDeclaration {
val obj = FirAnonymousObjectImpl(
source = toFirSourceElement(),
session,
ClassKind.ENUM_ENTRY,
scopeProvider,
FirAnonymousObjectSymbol()
)
val delegatedEntrySelfType = FirResolvedTypeRefImpl(
source = null,
type = ConeClassLikeTypeImpl(obj.symbol.toLookupTag(), emptyArray(), isNullable = false)
)
extractAnnotationsTo(obj)
obj.superTypeRefs += delegatedEnumSelfTypeRef
val superTypeCallEntry = superTypeListEntries.firstIsInstanceOrNull<KtSuperTypeCallEntry>()
val correctedEnumSelfTypeRef = FirResolvedTypeRefImpl(
source = superTypeCallEntry?.calleeExpression?.typeReference?.toFirSourceElement(),
type = delegatedEnumSelfTypeRef.type
)
obj.declarations += primaryConstructor.toFirConstructor(
superTypeCallEntry,
correctedEnumSelfTypeRef,
delegatedEntrySelfType,
owner = this
)
for (declaration in declarations) {
obj.declarations += declaration.toFirDeclaration(
correctedEnumSelfTypeRef,
delegatedSelfType = delegatedEntrySelfType,
this,
hasPrimaryConstructor = true
)
}
return FirEnumEntryImpl( return FirEnumEntryImpl(
source = toFirSourceElement(), source = toFirSourceElement(),
session, session,
delegatedEnumSelfTypeRef, delegatedEnumSelfTypeRef,
name = nameAsSafeName, name = nameAsSafeName,
initializer = obj, initializer = withChildClassName(nameAsSafeName) {
val obj = FirAnonymousObjectImpl(
source = toFirSourceElement(),
session,
ClassKind.ENUM_ENTRY,
scopeProvider,
FirAnonymousObjectSymbol()
)
val delegatedEntrySelfType = FirResolvedTypeRefImpl(
source = null,
type = ConeClassLikeTypeImpl(obj.symbol.toLookupTag(), emptyArray(), isNullable = false)
)
extractAnnotationsTo(obj)
obj.superTypeRefs += delegatedEnumSelfTypeRef
val superTypeCallEntry = superTypeListEntries.firstIsInstanceOrNull<KtSuperTypeCallEntry>()
val correctedEnumSelfTypeRef = FirResolvedTypeRefImpl(
source = superTypeCallEntry?.calleeExpression?.typeReference?.toFirSourceElement(),
type = delegatedEnumSelfTypeRef.type
)
obj.declarations += primaryConstructor.toFirConstructor(
superTypeCallEntry,
correctedEnumSelfTypeRef,
delegatedEntrySelfType,
owner = this
)
for (declaration in declarations) {
obj.declarations += declaration.toFirDeclaration(
correctedEnumSelfTypeRef,
delegatedSelfType = delegatedEntrySelfType,
this,
hasPrimaryConstructor = true
)
}
obj
},
status = FirDeclarationStatusImpl( status = FirDeclarationStatusImpl(
Visibilities.PUBLIC, Modality.FINAL Visibilities.PUBLIC, Modality.FINAL
).apply { ).apply {
@@ -5,107 +5,95 @@ FILE fqName:<root> fileName:/enumEntryReferenceFromEnumEntryClass.kt
BLOCK_BODY BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any' DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:MyEnum modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.MyEnum>]' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:MyEnum modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.MyEnum>]'
CLASS ENUM_ENTRY name:Z modality:FINAL visibility:public superTypes:[kotlin.Any] ENUM_ENTRY name:Z
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.MyEnum.Z class: CLASS ENUM_ENTRY name:Z modality:FINAL visibility:local superTypes:[<root>.MyEnum]
CONSTRUCTOR visibility:public <> () returnType:<root>.MyEnum.Z [primary] $this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.MyEnum.Z
BLOCK_BODY CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any' BLOCK_BODY
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.MyEnum'
PROPERTY name:counter visibility:public modality:FINAL [var] INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:Z modality:FINAL visibility:local superTypes:[<root>.MyEnum]'
FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private PROPERTY name:counter visibility:public modality:FINAL [var]
EXPRESSION_BODY FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private
CONST Int type=kotlin.Int value=0 EXPRESSION_BODY
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-counter> visibility:public modality:FINAL <> ($this:<root>.MyEnum.Z) returnType:kotlin.Int CONST Int type=kotlin.Int value=0
correspondingProperty: PROPERTY name:counter visibility:public modality:FINAL [var] FUN DEFAULT_PROPERTY_ACCESSOR name:<get-counter> visibility:public modality:FINAL <> ($this:<root>.MyEnum.Z) returnType:kotlin.Int
correspondingProperty: PROPERTY name:counter visibility:public modality:FINAL [var]
$this: VALUE_PARAMETER name:<this> type:<root>.MyEnum.Z
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-counter> (): kotlin.Int declared in <root>.MyEnum.Z'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.MyEnum.Z declared in <root>.MyEnum.Z.<get-counter>' type=<root>.MyEnum.Z origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<set-counter> visibility:public modality:FINAL <> ($this:<root>.MyEnum.Z, <set-?>:kotlin.Int) returnType:kotlin.Unit
correspondingProperty: PROPERTY name:counter visibility:public modality:FINAL [var]
$this: VALUE_PARAMETER name:<this> type:<root>.MyEnum.Z
VALUE_PARAMETER name:<set-?> index:0 type:kotlin.Int
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: <root>.MyEnum.Z declared in <root>.MyEnum.Z.<set-counter>' type=<root>.MyEnum.Z origin=null
value: GET_VAR '<set-?>: kotlin.Int declared in <root>.MyEnum.Z.<set-counter>' type=kotlin.Int origin=null
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.MyEnum.Z) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.MyEnum.Z $this: VALUE_PARAMETER name:<this> type:<root>.MyEnum.Z
BLOCK_BODY BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-counter> (): kotlin.Int declared in <root>.MyEnum.Z' FUN name:bar visibility:public modality:FINAL <> ($this:<root>.MyEnum.Z) returnType:kotlin.Unit
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.MyEnum.Z declared in <root>.MyEnum.Z.<get-counter>' type=<root>.MyEnum.Z origin=null
FUN DEFAULT_PROPERTY_ACCESSOR name:<set-counter> visibility:public modality:FINAL <> ($this:<root>.MyEnum.Z, <set-?>:kotlin.Int) returnType:kotlin.Unit
correspondingProperty: PROPERTY name:counter visibility:public modality:FINAL [var]
$this: VALUE_PARAMETER name:<this> type:<root>.MyEnum.Z $this: VALUE_PARAMETER name:<this> type:<root>.MyEnum.Z
VALUE_PARAMETER name:<set-?> index:0 type:kotlin.Int
BLOCK_BODY BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: <root>.MyEnum.Z declared in <root>.MyEnum.Z.<set-counter>' type=<root>.MyEnum.Z origin=null receiver: GET_VAR '<this>: <uninitialized parent>.<anonymous> declared in <no parent>.<anonymous>' type=<uninitialized parent>.<anonymous> origin=null
value: GET_VAR '<set-?>: kotlin.Int declared in <root>.MyEnum.Z.<set-counter>' type=kotlin.Int origin=null value: CONST Int type=kotlin.Int value=1
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.MyEnum.Z) returnType:kotlin.Unit CALL 'public final fun foo (): kotlin.Unit declared in <root>.MyEnum.Z' type=kotlin.Unit origin=null
$this: VALUE_PARAMETER name:<this> type:<root>.MyEnum.Z $this: GET_VAR '<this>: <uninitialized parent>.<anonymous> declared in <no parent>.<anonymous>' type=<uninitialized parent>.<anonymous> origin=null
BLOCK_BODY PROPERTY name:aLambda visibility:public modality:FINAL [val]
FUN name:bar visibility:public modality:FINAL <> ($this:<root>.MyEnum.Z) returnType:kotlin.Unit FIELD PROPERTY_BACKING_FIELD name:aLambda type:kotlin.Function0<kotlin.Unit> visibility:private [final]
$this: VALUE_PARAMETER name:<this> type:<root>.MyEnum.Z EXPRESSION_BODY
BLOCK_BODY FUN_EXPR type=kotlin.Function0<kotlin.Unit> origin=LAMBDA
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($this:<root>.MyEnum.Z) returnType:kotlin.Unit
receiver: GET_VAR '<this>: <root>.MyEnum.Z declared in <root>.MyEnum.Z' type=<root>.MyEnum.Z origin=null $this: VALUE_PARAMETER name:<this> type:<root>.MyEnum.Z
value: CONST Int type=kotlin.Int value=1
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
PROPERTY name:aLambda visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:aLambda type:kotlin.Function0<kotlin.Unit> visibility:private [final]
EXPRESSION_BODY
FUN_EXPR type=kotlin.Function0<kotlin.Unit> origin=LAMBDA
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> ($this:<root>.MyEnum.Z) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.MyEnum.Z
BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: <root>.MyEnum.Z declared in <root>.MyEnum.Z' type=<root>.MyEnum.Z origin=null
value: CONST Int type=kotlin.Int value=1
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
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-aLambda> visibility:public modality:FINAL <> ($this:<root>.MyEnum.Z) returnType:kotlin.Function0<kotlin.Unit>
correspondingProperty: PROPERTY name:aLambda 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-aLambda> (): kotlin.Function0<kotlin.Unit> declared in <root>.MyEnum.Z'
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:<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]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.MyEnum.Z.anObject.<no name provided>
CONSTRUCTOR visibility:private <> () returnType:kotlin.Any [primary]
BLOCK_BODY
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]'
ANONYMOUS_INITIALIZER isStatic=false
BLOCK_BODY BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: <root>.MyEnum.Z declared in <root>.MyEnum.Z' type=<root>.MyEnum.Z origin=null receiver: GET_VAR '<this>: <uninitialized parent>.<anonymous> declared in <no parent>.<anonymous>' type=<uninitialized parent>.<anonymous> origin=null
value: CONST Int type=kotlin.Int value=1 value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.MyEnum.Z' type=kotlin.Unit origin=null 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 $this: GET_VAR '<this>: <uninitialized parent>.<anonymous> declared in <no parent>.<anonymous>' type=<uninitialized parent>.<anonymous> origin=null
FUN name:test visibility:public modality:FINAL <> ($this:<root>.MyEnum.Z.anObject.<no name provided>) returnType:kotlin.Unit FUN DEFAULT_PROPERTY_ACCESSOR name:<get-aLambda> visibility:public modality:FINAL <> ($this:<root>.MyEnum.Z) returnType:kotlin.Function0<kotlin.Unit>
$this: VALUE_PARAMETER name:<this> type:<root>.MyEnum.Z.anObject.<no name provided> correspondingProperty: PROPERTY name:aLambda visibility:public modality:FINAL [val]
BLOCK_BODY $this: VALUE_PARAMETER name:<this> type:<root>.MyEnum.Z
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null BLOCK_BODY
receiver: GET_VAR '<this>: <root>.MyEnum.Z declared in <root>.MyEnum.Z' type=<root>.MyEnum.Z origin=null RETURN type=kotlin.Nothing from='public final fun <get-aLambda> (): kotlin.Function0<kotlin.Unit> declared in <root>.MyEnum.Z'
value: CONST Int type=kotlin.Int value=1 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:aLambda type:kotlin.Function0<kotlin.Unit> visibility:private [final]' type=kotlin.Function0<kotlin.Unit> origin=null
CALL 'public final fun foo (): kotlin.Unit declared in <root>.MyEnum.Z' type=kotlin.Unit origin=null receiver: GET_VAR '<this>: <root>.MyEnum.Z declared in <root>.MyEnum.Z.<get-aLambda>' type=<root>.MyEnum.Z origin=null
$this: GET_VAR '<this>: <root>.MyEnum.Z declared in <root>.MyEnum.Z' type=<root>.MyEnum.Z origin=null PROPERTY name:anObject visibility:public modality:FINAL [val]
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 FIELD PROPERTY_BACKING_FIELD name:anObject type:<uninitialized parent>.<anonymous> visibility:private [final]
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-anObject> visibility:public modality:FINAL <> ($this:<root>.MyEnum.Z) returnType:<uninitialized parent>.<anonymous> EXPRESSION_BODY
correspondingProperty: PROPERTY name:anObject visibility:public modality:FINAL [val] BLOCK type=<root>.MyEnum.Z.anObject.<no name provided> origin=OBJECT_LITERAL
$this: VALUE_PARAMETER name:<this> type:<root>.MyEnum.Z CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[kotlin.Any]
BLOCK_BODY $this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.MyEnum.Z.anObject.<no name provided>
RETURN type=kotlin.Nothing from='public final fun <get-anObject> (): <uninitialized parent>.<anonymous> declared in <root>.MyEnum.Z' CONSTRUCTOR visibility:private <> () returnType:kotlin.Any [primary]
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:anObject type:<uninitialized parent>.<anonymous> visibility:private [final]' type=<uninitialized parent>.<anonymous> origin=null BLOCK_BODY
receiver: GET_VAR '<this>: <root>.MyEnum.Z declared in <root>.MyEnum.Z.<get-anObject>' type=<root>.MyEnum.Z origin=null DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:<no name provided> modality:FINAL visibility:local superTypes:[kotlin.Any]'
overridden: ANONYMOUS_INITIALIZER isStatic=false
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any BLOCK_BODY
$this: VALUE_PARAMETER name:<this> type:kotlin.Any SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
VALUE_PARAMETER name:other index:0 type:kotlin.Any? receiver: GET_VAR '<this>: <uninitialized parent>.<anonymous> declared in <no parent>.<anonymous>' type=<uninitialized parent>.<anonymous> origin=null
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] value: CONST Int type=kotlin.Int value=1
overridden: CALL 'public final fun foo (): kotlin.Unit declared in <root>.MyEnum.Z' type=kotlin.Unit origin=null
public open fun hashCode (): kotlin.Int declared in kotlin.Any $this: GET_VAR '<this>: <uninitialized parent>.<anonymous> declared in <no parent>.<anonymous>' type=<uninitialized parent>.<anonymous> origin=null
$this: VALUE_PARAMETER name:<this> type:kotlin.Any FUN name:test visibility:public modality:FINAL <> ($this:<root>.MyEnum.Z.anObject.<no name provided>) returnType:kotlin.Unit
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] $this: VALUE_PARAMETER name:<this> type:<root>.MyEnum.Z.anObject.<no name provided>
overridden: BLOCK_BODY
public open fun toString (): kotlin.String declared in kotlin.Any SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
$this: VALUE_PARAMETER name:<this> type:kotlin.Any receiver: GET_VAR '<this>: <uninitialized parent>.<anonymous> declared in <no parent>.<anonymous>' type=<uninitialized parent>.<anonymous> origin=null
value: CONST Int type=kotlin.Int value=1
CALL 'public final fun foo (): kotlin.Unit declared in <root>.MyEnum.Z' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <uninitialized parent>.<anonymous> declared in <no parent>.<anonymous>' type=<uninitialized parent>.<anonymous> 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:<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> (): <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 name:values visibility:public modality:FINAL <> ($this:<root>.MyEnum) returnType:kotlin.Array<<root>.MyEnum> FUN name:values visibility:public modality:FINAL <> ($this:<root>.MyEnum) returnType:kotlin.Array<<root>.MyEnum>
$this: VALUE_PARAMETER name:<this> type:<root>.MyEnum $this: VALUE_PARAMETER name:<this> type:<root>.MyEnum
BLOCK_BODY BLOCK_BODY