FIR2IR: use enum constructor call for enum entries

This commit is contained in:
Mikhail Glukhikh
2020-02-19 12:34:56 +03:00
parent 9e3f17c52a
commit f173af9238
16 changed files with 66 additions and 55 deletions
@@ -404,16 +404,25 @@ class Fir2IrVisitor(
}
}
private fun FirDelegatedConstructorCall.toIrDelegatingConstructorCall(): IrDelegatingConstructorCall? {
private fun FirDelegatedConstructorCall.toIrDelegatingConstructorCall(): IrCallWithIndexedArgumentsBase? {
val constructedIrType = constructedTypeRef.toIrType(this@Fir2IrVisitor.session, declarationStorage)
val constructorSymbol = (this.calleeReference as? FirResolvedNamedReference)?.resolvedSymbol as? FirConstructorSymbol
?: return null
return convertWithOffsets { startOffset, endOffset ->
IrDelegatingConstructorCallImpl(
startOffset, endOffset,
constructedIrType,
declarationStorage.getIrFunctionSymbol(constructorSymbol) as IrConstructorSymbol
).apply {
val irConstructorSymbol = declarationStorage.getIrFunctionSymbol(constructorSymbol) as IrConstructorSymbol
if (constructorSymbol.fir.isFromEnumClass) {
IrEnumConstructorCallImpl(
startOffset, endOffset,
constructedIrType,
irConstructorSymbol
)
} else {
IrDelegatingConstructorCallImpl(
startOffset, endOffset,
constructedIrType,
irConstructorSymbol
)
}.apply {
for ((index, argument) in arguments.withIndex()) {
val argumentExpression = argument.toIrExpression()
putValueArgument(index, argumentExpression)
@@ -421,7 +421,7 @@ internal object CheckVisibility : CheckerStage() {
}
Visibilities.PRIVATE, Visibilities.PRIVATE_TO_THIS -> {
if (declaration.session == callInfo.session) {
if (ownerId == null || declaration is FirConstructor && declaration.status.isFromSealedClass) {
if (ownerId == null || declaration is FirConstructor && declaration.isFromSealedClass) {
// Top-level: visible in file
candidateFile == useSiteFile
} else {
@@ -39,6 +39,8 @@ inline val FirMemberDeclaration.isExternal: Boolean get() = status.isExternal
inline val FirMemberDeclaration.isSuspend: Boolean get() = status.isSuspend
inline val FirMemberDeclaration.isConst: Boolean get() = status.isConst
inline val FirMemberDeclaration.isLateInit: Boolean get() = status.isLateInit
inline val FirMemberDeclaration.isFromSealedClass: Boolean get() = status.isFromSealedClass
inline val FirMemberDeclaration.isFromEnumClass: Boolean get() = status.isFromEnumClass
inline val FirPropertyAccessor.modality get() = status.modality
inline val FirPropertyAccessor.visibility get() = status.visibility
+12 -12
View File
@@ -10,14 +10,14 @@ FILE fqName:<root> fileName:/enum.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum1.TEST1
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestEnum1'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestEnum1'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST1 modality:FINAL visibility:private superTypes:[<root>.TestEnum1]'
ENUM_ENTRY name:TEST2
class: CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:private superTypes:[<root>.TestEnum1]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum1.TEST2
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestEnum1'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestEnum1'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:private superTypes:[<root>.TestEnum1]'
FUN name:values visibility:public modality:FINAL <> ($this:<root>.TestEnum1) returnType:kotlin.Array<<root>.TestEnum1>
$this: VALUE_PARAMETER name:<this> type:<root>.TestEnum1
@@ -83,7 +83,7 @@ FILE fqName:<root> fileName:/enum.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum2.TEST1
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.TestEnum2'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.TestEnum2'
x: CONST Int type=kotlin.Int value=1
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST1 modality:FINAL visibility:private superTypes:[<root>.TestEnum2]'
ENUM_ENTRY name:TEST2
@@ -91,7 +91,7 @@ FILE fqName:<root> fileName:/enum.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum2.TEST2
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.TestEnum2'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.TestEnum2'
x: CONST Int type=kotlin.Int value=2
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:private superTypes:[<root>.TestEnum2]'
ENUM_ENTRY name:TEST3
@@ -99,7 +99,7 @@ FILE fqName:<root> fileName:/enum.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum2.TEST3
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.TestEnum2'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.TestEnum2'
x: CONST Int type=kotlin.Int value=3
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST3 modality:FINAL visibility:private superTypes:[<root>.TestEnum2]'
FUN name:values visibility:public modality:FINAL <> ($this:<root>.TestEnum2) returnType:kotlin.Array<<root>.TestEnum2>
@@ -154,7 +154,7 @@ FILE fqName:<root> fileName:/enum.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum3.TEST
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestEnum3'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestEnum3'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST modality:FINAL visibility:private superTypes:[<root>.TestEnum3]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.TestEnum3.TEST) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.TestEnum3.TEST
@@ -227,7 +227,7 @@ FILE fqName:<root> fileName:/enum.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum4.TEST1
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.TestEnum4'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.TestEnum4'
x: CONST Int type=kotlin.Int value=1
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST1 modality:FINAL visibility:private superTypes:[<root>.TestEnum4]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.TestEnum4.TEST1) returnType:kotlin.Unit
@@ -240,7 +240,7 @@ FILE fqName:<root> fileName:/enum.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum4.TEST2
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.TestEnum4'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.TestEnum4'
x: CONST Int type=kotlin.Int value=2
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:private superTypes:[<root>.TestEnum4]'
PROPERTY name:z visibility:public modality:FINAL [val]
@@ -330,21 +330,21 @@ FILE fqName:<root> fileName:/enum.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum5.TEST1
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.TestEnum5'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.TestEnum5'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST1 modality:FINAL visibility:private superTypes:[<root>.TestEnum5]'
ENUM_ENTRY name:TEST2
class: CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:private superTypes:[<root>.TestEnum5]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum5.TEST2
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.TestEnum5'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.TestEnum5'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:private superTypes:[<root>.TestEnum5]'
ENUM_ENTRY name:TEST3
class: CLASS ENUM_ENTRY name:TEST3 modality:FINAL visibility:private superTypes:[<root>.TestEnum5]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum5.TEST3
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.TestEnum5'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.TestEnum5'
x: CONST Int type=kotlin.Int value=0
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST3 modality:FINAL visibility:private superTypes:[<root>.TestEnum5]'
FUN name:values visibility:public modality:FINAL <> ($this:<root>.TestEnum5) returnType:kotlin.Array<<root>.TestEnum5>
@@ -427,7 +427,7 @@ FILE fqName:<root> fileName:/enum.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum6.TEST
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int, y: kotlin.Int) [primary] declared in <root>.TestEnum6'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int, y: kotlin.Int) [primary] declared in <root>.TestEnum6'
x: CALL 'public final fun f (): kotlin.Int declared in <root>' type=kotlin.Int origin=null
y: CALL 'public final fun f (): kotlin.Int declared in <root>' type=kotlin.Int origin=null
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST modality:FINAL visibility:private superTypes:[<root>.TestEnum6]'
@@ -10,7 +10,7 @@ FILE fqName:<root> fileName:/enumClassModality.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestFinalEnum1.X1
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestFinalEnum1'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestFinalEnum1'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[<root>.TestFinalEnum1]'
FUN name:values visibility:public modality:FINAL <> ($this:<root>.TestFinalEnum1) returnType:kotlin.Array<<root>.TestFinalEnum1>
$this: VALUE_PARAMETER name:<this> type:<root>.TestFinalEnum1
@@ -76,7 +76,7 @@ FILE fqName:<root> fileName:/enumClassModality.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestFinalEnum2.X1
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.TestFinalEnum2'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.TestFinalEnum2'
x: CONST Int type=kotlin.Int value=1
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[<root>.TestFinalEnum2]'
FUN name:values visibility:public modality:FINAL <> ($this:<root>.TestFinalEnum2) returnType:kotlin.Array<<root>.TestFinalEnum2>
@@ -131,7 +131,7 @@ FILE fqName:<root> fileName:/enumClassModality.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestFinalEnum3.X1
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestFinalEnum3'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestFinalEnum3'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[<root>.TestFinalEnum3]'
FUN name:doStuff visibility:public modality:FINAL <> ($this:<root>.TestFinalEnum3) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.TestFinalEnum3
@@ -188,7 +188,7 @@ FILE fqName:<root> fileName:/enumClassModality.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestOpenEnum1.X1
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestOpenEnum1'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestOpenEnum1'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[<root>.TestOpenEnum1]'
FUN name:toString visibility:public modality:FINAL <> ($this:<root>.TestOpenEnum1.X1) returnType:kotlin.String
$this: VALUE_PARAMETER name:<this> type:<root>.TestOpenEnum1.X1
@@ -247,7 +247,7 @@ FILE fqName:<root> fileName:/enumClassModality.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestOpenEnum2.X1
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestOpenEnum2'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestOpenEnum2'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[<root>.TestOpenEnum2]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.TestOpenEnum2.X1) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.TestOpenEnum2.X1
@@ -307,7 +307,7 @@ FILE fqName:<root> fileName:/enumClassModality.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestAbstractEnum1.X1
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestAbstractEnum1'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestAbstractEnum1'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[<root>.TestAbstractEnum1]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.TestAbstractEnum1.X1) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.TestAbstractEnum1.X1
@@ -383,7 +383,7 @@ FILE fqName:<root> fileName:/enumClassModality.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestAbstractEnum2.X1
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestAbstractEnum2'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestAbstractEnum2'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:private superTypes:[<root>.TestAbstractEnum2]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.TestAbstractEnum2.X1) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.TestAbstractEnum2.X1
@@ -6,7 +6,7 @@ FILE fqName:<root> fileName:/enumWithMultipleCtors.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.A.X
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> (arg: kotlin.String) declared in <root>.A'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> (arg: kotlin.String) declared in <root>.A'
arg: CONST String type=kotlin.String value="asd"
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X modality:FINAL visibility:private superTypes:[<root>.A]'
ENUM_ENTRY name:Y
@@ -14,7 +14,7 @@ FILE fqName:<root> fileName:/enumWithMultipleCtors.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.A.Y
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () declared in <root>.A'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () declared in <root>.A'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:Y modality:FINAL visibility:private superTypes:[<root>.A]'
FUN name:f visibility:public modality:FINAL <> ($this:<root>.A.Y) returnType:kotlin.String
$this: VALUE_PARAMETER name:<this> type:<root>.A.Y
@@ -29,7 +29,7 @@ FILE fqName:<root> fileName:/enumWithMultipleCtors.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.A.Z
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) declared in <root>.A'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) declared in <root>.A'
x: CONST Int type=kotlin.Int value=5
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:Z modality:FINAL visibility:private superTypes:[<root>.A]'
PROPERTY name:prop1 visibility:public modality:FINAL [val]
@@ -95,7 +95,7 @@ FILE fqName:<root> fileName:/enumWithMultipleCtors.kt
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop3 type:kotlin.String visibility:private' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: <root>.A declared in <root>.A' type=<root>.A origin=null
value: CONST String type=kotlin.String value="int"
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> (arg: kotlin.String) declared in <root>.A'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> (arg: kotlin.String) declared in <root>.A'
arg: CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null
$this: GET_VAR 'x: kotlin.Int declared in <root>.A.<init>' type=kotlin.Int origin=null
FUN name:f visibility:public modality:OPEN <> ($this:<root>.A) returnType:kotlin.String
@@ -22,11 +22,11 @@ FILE fqName:<root> fileName:/enumWithSecondaryCtor.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Test0.ZERO
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () declared in <root>.Test0'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () declared in <root>.Test0'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ZERO modality:FINAL visibility:private superTypes:[<root>.Test0]'
CONSTRUCTOR visibility:private <> () returnType:<root>.Test0
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.Test0'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.Test0'
x: CONST Int type=kotlin.Int value=0
FUN name:values visibility:public modality:FINAL <> ($this:<root>.Test0) returnType:kotlin.Array<<root>.Test0>
$this: VALUE_PARAMETER name:<this> type:<root>.Test0
@@ -92,19 +92,19 @@ FILE fqName:<root> fileName:/enumWithSecondaryCtor.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Test1.ZERO
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () declared in <root>.Test1'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () declared in <root>.Test1'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ZERO modality:FINAL visibility:private superTypes:[<root>.Test1]'
ENUM_ENTRY name:ONE
class: CLASS ENUM_ENTRY name:ONE modality:FINAL visibility:private superTypes:[<root>.Test1]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Test1.ONE
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.Test1'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.Test1'
x: CONST Int type=kotlin.Int value=1
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ONE modality:FINAL visibility:private superTypes:[<root>.Test1]'
CONSTRUCTOR visibility:private <> () returnType:<root>.Test1
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.Test1'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.Test1'
x: CONST Int type=kotlin.Int value=0
FUN name:values visibility:public modality:FINAL <> ($this:<root>.Test1) returnType:kotlin.Array<<root>.Test1>
$this: VALUE_PARAMETER name:<this> type:<root>.Test1
@@ -170,7 +170,7 @@ FILE fqName:<root> fileName:/enumWithSecondaryCtor.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Test2.ZERO
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () declared in <root>.Test2'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () declared in <root>.Test2'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ZERO modality:FINAL visibility:private superTypes:[<root>.Test2]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.Test2.ZERO) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Test2.ZERO
@@ -182,7 +182,7 @@ FILE fqName:<root> fileName:/enumWithSecondaryCtor.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Test2.ONE
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.Test2'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.Test2'
x: CONST Int type=kotlin.Int value=1
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ONE modality:FINAL visibility:private superTypes:[<root>.Test2]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.Test2.ONE) returnType:kotlin.Unit
@@ -192,7 +192,7 @@ FILE fqName:<root> fileName:/enumWithSecondaryCtor.kt
message: CONST String type=kotlin.String value="ONE"
CONSTRUCTOR visibility:private <> () returnType:<root>.Test2
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.Test2'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.Test2'
x: CONST Int type=kotlin.Int value=0
FUN name:foo visibility:public modality:ABSTRACT <> ($this:<root>.Test2) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Test2
@@ -40,7 +40,7 @@ FILE fqName:<root> fileName:/enumEntriesWithAnnotations.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum.ENTRY1
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestEnum'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestEnum'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ENTRY1 modality:FINAL visibility:private superTypes:[<root>.TestEnum]'
ENUM_ENTRY name:ENTRY2
class: CLASS ENUM_ENTRY name:ENTRY2 modality:FINAL visibility:private superTypes:[<root>.TestEnum]
@@ -49,7 +49,7 @@ FILE fqName:<root> fileName:/enumEntriesWithAnnotations.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum.ENTRY2
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestEnum'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestEnum'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ENTRY2 modality:FINAL visibility:private superTypes:[<root>.TestEnum]'
PROPERTY name:x visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]
@@ -10,28 +10,28 @@ FILE fqName:<root> fileName:/enumsInAnnotationArguments.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.En.A
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.En'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.En'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:A modality:FINAL visibility:private superTypes:[<root>.En]'
ENUM_ENTRY name:B
class: CLASS ENUM_ENTRY name:B modality:FINAL visibility:private superTypes:[<root>.En]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.En.B
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.En'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.En'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:B modality:FINAL visibility:private superTypes:[<root>.En]'
ENUM_ENTRY name:C
class: CLASS ENUM_ENTRY name:C modality:FINAL visibility:private superTypes:[<root>.En]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.En.C
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.En'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.En'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:C modality:FINAL visibility:private superTypes:[<root>.En]'
ENUM_ENTRY name:D
class: CLASS ENUM_ENTRY name:D modality:FINAL visibility:private superTypes:[<root>.En]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.En.D
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.En'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.En'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:D modality:FINAL visibility:private superTypes:[<root>.En]'
FUN name:values visibility:public modality:FINAL <> ($this:<root>.En) returnType:kotlin.Array<<root>.En>
$this: VALUE_PARAMETER name:<this> type:<root>.En
@@ -10,14 +10,14 @@ FILE fqName:<root> fileName:/expectedEnumClass.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.MyEnum.FOO
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.MyEnum'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.MyEnum'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:FOO modality:FINAL visibility:private superTypes:[<root>.MyEnum]'
ENUM_ENTRY name:BAR
class: CLASS ENUM_ENTRY name:BAR modality:FINAL visibility:private superTypes:[<root>.MyEnum]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.MyEnum.BAR
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.MyEnum'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.MyEnum'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:BAR modality:FINAL visibility:private superTypes:[<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
@@ -71,21 +71,21 @@ FILE fqName:<root> fileName:/expectedEnumClass.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.MyEnum.FOO
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.MyEnum'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.MyEnum'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:FOO modality:FINAL visibility:private superTypes:[<root>.MyEnum]'
ENUM_ENTRY name:BAR
class: CLASS ENUM_ENTRY name:BAR modality:FINAL visibility:private superTypes:[<root>.MyEnum]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.MyEnum.BAR
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.MyEnum'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.MyEnum'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:BAR modality:FINAL visibility:private superTypes:[<root>.MyEnum]'
ENUM_ENTRY name:BAZ
class: CLASS ENUM_ENTRY name:BAZ modality:FINAL visibility:private superTypes:[<root>.MyEnum]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.MyEnum.BAZ
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.MyEnum'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.MyEnum'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:BAZ modality:FINAL visibility:private superTypes:[<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
@@ -10,7 +10,7 @@ FILE fqName:<root> fileName:/enumEntryAsReceiver.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.X.B
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.X'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.X'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:B modality:FINAL visibility:private superTypes:[<root>.X]'
PROPERTY name:value2 visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.String visibility:private [final]
@@ -10,7 +10,7 @@ FILE fqName:<root> fileName:/enumEntryReferenceFromEnumEntryClass.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.MyEnum.Z
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.MyEnum'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.MyEnum'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:Z modality:FINAL visibility:private superTypes:[<root>.MyEnum]'
PROPERTY name:counter visibility:public modality:FINAL [var]
FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private
@@ -29,7 +29,7 @@ FILE fqName:<root> fileName:/objectAsCallable.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.En.X
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.En'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.En'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X modality:FINAL visibility:private superTypes:[<root>.En]'
FUN name:values visibility:public modality:FINAL <> ($this:<root>.En) returnType:kotlin.Array<<root>.En>
$this: VALUE_PARAMETER name:<this> type:<root>.En
@@ -31,7 +31,7 @@ FILE fqName:<root> fileName:/temporaryInEnumEntryInitializer.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.En.ENTRY
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.String?) [primary] declared in <root>.En'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.String?) [primary] declared in <root>.En'
x: CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String? origin=null
$this: CALL 'public final fun <get-n> (): kotlin.Any? declared in <root>' type=kotlin.Any? origin=null
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ENTRY modality:FINAL visibility:private superTypes:[<root>.En]'
+1 -1
View File
@@ -10,7 +10,7 @@ FILE fqName:<root> fileName:/values.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Enum.A
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.Enum'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.Enum'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:A modality:FINAL visibility:private superTypes:[<root>.Enum]'
FUN name:values visibility:public modality:FINAL <> ($this:<root>.Enum) returnType:kotlin.Array<<root>.Enum>
$this: VALUE_PARAMETER name:<this> type:<root>.Enum
+1 -1
View File
@@ -10,7 +10,7 @@ FILE fqName:<root> fileName:/enumEntry.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Z.ENTRY
CONSTRUCTOR visibility:private <> () returnType:<uninitialized parent>.<anonymous> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.Z'
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.Z'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ENTRY modality:FINAL visibility:private superTypes:[<root>.Z]'
FUN name:test visibility:public modality:FINAL <> ($this:<root>.Z.ENTRY) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Z.ENTRY