PSI2IR: generate IrEnumConstructorCalls with correct return type
Normally, the fact that is was Unit was not visible as enum constructors are lowered to normal class constructors anyway. The exception is when the arguments are reordered, causing the incorrect return type to leak into the block that holds temporary variables.
This commit is contained in:
@@ -160,9 +160,10 @@ class CallGenerator(statementGenerator: StatementGenerator) : StatementGenerator
|
||||
if (dispatchReceiver != null) throw AssertionError("Dispatch receiver should be null: $dispatchReceiver")
|
||||
if (extensionReceiver != null) throw AssertionError("Extension receiver should be null: $extensionReceiver")
|
||||
val constructorSymbol = context.symbolTable.referenceConstructor(constructorDescriptor.original)
|
||||
val irCall = IrEnumConstructorCallImpl(startOffset, endOffset, context.irBuiltIns.unitType, constructorSymbol)
|
||||
val returnType = constructorDescriptor.returnType.toIrType()
|
||||
val irCall = IrEnumConstructorCallImpl(startOffset, endOffset, returnType, constructorSymbol)
|
||||
context.callToSubstitutedDescriptorMap[irCall] = constructorDescriptor
|
||||
addParametersToCall(startOffset, endOffset, call, irCall, context.irBuiltIns.unitType)
|
||||
addParametersToCall(startOffset, endOffset, call, irCall, irCall.type)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// IGNORE_BACKEND: JS
|
||||
fun f(): String = "O"
|
||||
fun g(): String = "K"
|
||||
|
||||
enum class E(val x: String, val y: String) {
|
||||
A(y = g(), x = f())
|
||||
}
|
||||
|
||||
fun box(): String = E.A.x + E.A.y
|
||||
+7
-1
@@ -41,4 +41,10 @@ enum class TestEnum4(val x: Int) {
|
||||
|
||||
enum class TestEnum5(val x: Int = 0) {
|
||||
TEST1, TEST2(), TEST3(0)
|
||||
}
|
||||
}
|
||||
|
||||
fun f(): Int = 1
|
||||
|
||||
enum class TestEnum6(val x: Int, val y: Int) {
|
||||
TEST(y = f(), x = f())
|
||||
}
|
||||
|
||||
+99
-5
@@ -145,7 +145,8 @@ FILE fqName:<root> fileName:/enum.kt
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum3.TEST
|
||||
CONSTRUCTOR visibility:private <> () returnType:<root>.TestEnum3.TEST [primary]
|
||||
BLOCK_BODY
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestEnum3'
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestEnum3'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST modality:FINAL visibility:public superTypes:[<root>.TestEnum3]'
|
||||
FUN name:foo visibility:public modality:OPEN <> ($this:<root>.TestEnum3.TEST) returnType:kotlin.Unit
|
||||
overridden:
|
||||
@@ -270,8 +271,9 @@ FILE fqName:<root> fileName:/enum.kt
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum4.TEST1
|
||||
CONSTRUCTOR visibility:private <> () returnType:<root>.TestEnum4.TEST1 [primary]
|
||||
BLOCK_BODY
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.TestEnum4'
|
||||
x: CONST Int type=kotlin.Int value=1
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
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:public superTypes:[<root>.TestEnum4]'
|
||||
FUN name:foo visibility:public modality:OPEN <> ($this:<root>.TestEnum4.TEST1) returnType:kotlin.Unit
|
||||
overridden:
|
||||
@@ -334,8 +336,9 @@ FILE fqName:<root> fileName:/enum.kt
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum4.TEST2
|
||||
CONSTRUCTOR visibility:private <> () returnType:<root>.TestEnum4.TEST2 [primary]
|
||||
BLOCK_BODY
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.TestEnum4'
|
||||
x: CONST Int type=kotlin.Int value=2
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
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:public superTypes:[<root>.TestEnum4]'
|
||||
PROPERTY name:z visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Int visibility:private [final]
|
||||
@@ -531,3 +534,94 @@ FILE fqName:<root> fileName:/enum.kt
|
||||
FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:<root>.TestEnum5
|
||||
VALUE_PARAMETER name:value index:0 type:kotlin.String
|
||||
SYNTHETIC_BODY kind=ENUM_VALUEOF
|
||||
FUN name:f visibility:public modality:FINAL <> () returnType:kotlin.Int
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun f (): kotlin.Int declared in <root>'
|
||||
CONST Int type=kotlin.Int value=1
|
||||
CLASS ENUM_CLASS name:TestEnum6 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestEnum6>]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum6
|
||||
CONSTRUCTOR visibility:private <> (x:kotlin.Int, y:kotlin.Int) returnType:<root>.TestEnum6 [primary]
|
||||
VALUE_PARAMETER name:x index:0 type:kotlin.Int
|
||||
VALUE_PARAMETER name:y index:1 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
ENUM_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
|
||||
<E>: <root>.TestEnum6
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum6 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestEnum6>]'
|
||||
PROPERTY name:x visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
GET_VAR 'x: kotlin.Int declared in <root>.TestEnum6.<init>' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:FINAL <> ($this:<root>.TestEnum6) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.TestEnum6
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-x> (): kotlin.Int declared in <root>.TestEnum6'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.TestEnum6 declared in <root>.TestEnum6.<get-x>' type=<root>.TestEnum6 origin=null
|
||||
PROPERTY name:y visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
GET_VAR 'y: kotlin.Int declared in <root>.TestEnum6.<init>' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-y> visibility:public modality:FINAL <> ($this:<root>.TestEnum6) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.TestEnum6
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-y> (): kotlin.Int declared in <root>.TestEnum6'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: <root>.TestEnum6 declared in <root>.TestEnum6.<get-y>' type=<root>.TestEnum6 origin=null
|
||||
ENUM_ENTRY name:TEST
|
||||
init: BLOCK type=<root>.TestEnum6 origin=ARGUMENTS_REORDERING_FOR_CALL
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int [val]
|
||||
CALL 'public final fun f (): kotlin.Int declared in <root>' type=kotlin.Int origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val]
|
||||
CALL 'public final fun f (): kotlin.Int declared in <root>' type=kotlin.Int origin=null
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int, y: kotlin.Int) [primary] declared in <root>.TestEnum6'
|
||||
x: GET_VAR 'val tmp_1: kotlin.Int [val] declared in <root>.TestEnum6' type=kotlin.Int origin=null
|
||||
y: GET_VAR 'val tmp_0: kotlin.Int [val] declared in <root>.TestEnum6' type=kotlin.Int origin=null
|
||||
FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum<<root>.TestEnum6>) returnType:kotlin.Any [fake_override]
|
||||
overridden:
|
||||
protected final fun clone (): kotlin.Any declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.TestEnum6>
|
||||
FUN FAKE_OVERRIDE name:finalize visibility:protected/*protected and package*/ modality:FINAL <> ($this:kotlin.Enum<<root>.TestEnum6>) returnType:kotlin.Unit [fake_override]
|
||||
overridden:
|
||||
protected/*protected and package*/ final fun finalize (): kotlin.Unit declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.TestEnum6>
|
||||
FUN FAKE_OVERRIDE name:getDeclaringClass visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.TestEnum6>) returnType:java.lang.Class<<root>.TestEnum6?>? [fake_override]
|
||||
overridden:
|
||||
public final fun getDeclaringClass (): java.lang.Class<E of kotlin.Enum?>? declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.TestEnum6>
|
||||
FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.TestEnum6>, other:<root>.TestEnum6) returnType:kotlin.Int [fake_override]
|
||||
overridden:
|
||||
public final fun compareTo (other: E of kotlin.Enum): kotlin.Int declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.TestEnum6>
|
||||
VALUE_PARAMETER name:other index:0 type:<root>.TestEnum6
|
||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.TestEnum6>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override]
|
||||
overridden:
|
||||
public final fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.TestEnum6>
|
||||
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
|
||||
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.TestEnum6>) returnType:kotlin.Int [fake_override]
|
||||
overridden:
|
||||
public final fun hashCode (): kotlin.Int declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.TestEnum6>
|
||||
PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val]
|
||||
FUN FAKE_OVERRIDE name:<get-name> visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.TestEnum6>) returnType:kotlin.String [fake_override]
|
||||
correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val]
|
||||
overridden:
|
||||
public final fun <get-name> (): kotlin.String declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.TestEnum6>
|
||||
PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val]
|
||||
FUN FAKE_OVERRIDE name:<get-ordinal> visibility:public modality:FINAL <> ($this:kotlin.Enum<<root>.TestEnum6>) returnType:kotlin.Int [fake_override]
|
||||
correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val]
|
||||
overridden:
|
||||
public final fun <get-ordinal> (): kotlin.Int declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.TestEnum6>
|
||||
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<<root>.TestEnum6>) returnType:kotlin.String [fake_override]
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Enum
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum<<root>.TestEnum6>
|
||||
FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<<root>.TestEnum6>
|
||||
SYNTHETIC_BODY kind=ENUM_VALUES
|
||||
FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:<root>.TestEnum6
|
||||
VALUE_PARAMETER name:value index:0 type:kotlin.String
|
||||
SYNTHETIC_BODY kind=ENUM_VALUEOF
|
||||
|
||||
@@ -196,7 +196,8 @@ FILE fqName:<root> fileName:/enumClassModality.kt
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestOpenEnum1.X1
|
||||
CONSTRUCTOR visibility:private <> () returnType:<root>.TestOpenEnum1.X1 [primary]
|
||||
BLOCK_BODY
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestOpenEnum1'
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestOpenEnum1'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:public superTypes:[<root>.TestOpenEnum1]'
|
||||
FUN name:toString visibility:public modality:OPEN <> ($this:<root>.TestOpenEnum1.X1) returnType:kotlin.String
|
||||
overridden:
|
||||
@@ -303,7 +304,8 @@ FILE fqName:<root> fileName:/enumClassModality.kt
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestOpenEnum2.X1
|
||||
CONSTRUCTOR visibility:private <> () returnType:<root>.TestOpenEnum2.X1 [primary]
|
||||
BLOCK_BODY
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestOpenEnum2'
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestOpenEnum2'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:public superTypes:[<root>.TestOpenEnum2]'
|
||||
FUN name:foo visibility:public modality:OPEN <> ($this:<root>.TestOpenEnum2.X1) returnType:kotlin.Unit
|
||||
overridden:
|
||||
@@ -415,7 +417,8 @@ FILE fqName:<root> fileName:/enumClassModality.kt
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestAbstractEnum1.X1
|
||||
CONSTRUCTOR visibility:private <> () returnType:<root>.TestAbstractEnum1.X1 [primary]
|
||||
BLOCK_BODY
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestAbstractEnum1'
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestAbstractEnum1'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:public superTypes:[<root>.TestAbstractEnum1]'
|
||||
FUN name:foo visibility:public modality:OPEN <> ($this:<root>.TestAbstractEnum1.X1) returnType:kotlin.Unit
|
||||
overridden:
|
||||
@@ -543,7 +546,8 @@ FILE fqName:<root> fileName:/enumClassModality.kt
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestAbstractEnum2.X1
|
||||
CONSTRUCTOR visibility:private <> () returnType:<root>.TestAbstractEnum2.X1 [primary]
|
||||
BLOCK_BODY
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestAbstractEnum2'
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestAbstractEnum2'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:public superTypes:[<root>.TestAbstractEnum2]'
|
||||
FUN name:foo visibility:public modality:OPEN <> ($this:<root>.TestAbstractEnum2.X1) returnType:kotlin.Unit
|
||||
overridden:
|
||||
|
||||
@@ -171,7 +171,8 @@ FILE fqName:<root> fileName:/enumWithSecondaryCtor.kt
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Test2.ZERO
|
||||
CONSTRUCTOR visibility:private <> () returnType:<root>.Test2.ZERO [primary]
|
||||
BLOCK_BODY
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () declared in <root>.Test2'
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () declared in <root>.Test2'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ZERO modality:FINAL visibility:public superTypes:[<root>.Test2]'
|
||||
FUN name:foo visibility:public modality:OPEN <> ($this:<root>.Test2.ZERO) returnType:kotlin.Unit
|
||||
overridden:
|
||||
@@ -234,8 +235,9 @@ FILE fqName:<root> fileName:/enumWithSecondaryCtor.kt
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Test2.ONE
|
||||
CONSTRUCTOR visibility:private <> () returnType:<root>.Test2.ONE [primary]
|
||||
BLOCK_BODY
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int) [primary] declared in <root>.Test2'
|
||||
x: CONST Int type=kotlin.Int value=1
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
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:public superTypes:[<root>.Test2]'
|
||||
FUN name:foo visibility:public modality:OPEN <> ($this:<root>.Test2.ONE) returnType:kotlin.Unit
|
||||
overridden:
|
||||
|
||||
+2
-1
@@ -48,7 +48,8 @@ FILE fqName:<root> fileName:/enumEntriesWithAnnotations.kt
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum.ENTRY2
|
||||
CONSTRUCTOR visibility:private <> () returnType:<root>.TestEnum.ENTRY2 [primary]
|
||||
BLOCK_BODY
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestEnum'
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.TestEnum'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ENTRY2 modality:FINAL visibility:public superTypes:[<root>.TestEnum]'
|
||||
PROPERTY name:x visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]
|
||||
|
||||
@@ -12,7 +12,8 @@ FILE fqName:<root> fileName:/enumEntryAsReceiver.kt
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.X.B
|
||||
CONSTRUCTOR visibility:private <> () returnType:<root>.X.B [primary]
|
||||
BLOCK_BODY
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.X'
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.X'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:B modality:FINAL visibility:public superTypes:[<root>.X]'
|
||||
PROPERTY name:value2 visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.String visibility:private [final]
|
||||
|
||||
+2
-1
@@ -12,7 +12,8 @@ FILE fqName:<root> fileName:/enumEntryReferenceFromEnumEntryClass.kt
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.MyEnum.Z
|
||||
CONSTRUCTOR visibility:private <> () returnType:<root>.MyEnum.Z [primary]
|
||||
BLOCK_BODY
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.MyEnum'
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.MyEnum'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:Z modality:FINAL visibility:public superTypes:[<root>.MyEnum]'
|
||||
PROPERTY name:counter visibility:public modality:FINAL [var]
|
||||
FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private
|
||||
|
||||
+2
-1
@@ -12,7 +12,8 @@ FILE fqName:<root> fileName:/enumEntry.kt
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Z.ENTRY
|
||||
CONSTRUCTOR visibility:private <> () returnType:<root>.Z.ENTRY [primary]
|
||||
BLOCK_BODY
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.Z'
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.Z'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ENTRY modality:FINAL visibility:public 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
|
||||
|
||||
+5
@@ -10487,6 +10487,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/enum/companionObjectInEnum.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("constructorWithReordering.kt")
|
||||
public void testConstructorWithReordering() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/enum/constructorWithReordering.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("deepInnerClassInEnumEntryClass.kt")
|
||||
public void testDeepInnerClassInEnumEntryClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/enum/deepInnerClassInEnumEntryClass.kt");
|
||||
|
||||
+5
@@ -10487,6 +10487,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/enum/companionObjectInEnum.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("constructorWithReordering.kt")
|
||||
public void testConstructorWithReordering() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/enum/constructorWithReordering.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("deepInnerClassInEnumEntryClass.kt")
|
||||
public void testDeepInnerClassInEnumEntryClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/enum/deepInnerClassInEnumEntryClass.kt");
|
||||
|
||||
+5
@@ -9337,6 +9337,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/enum/companionObjectInEnum.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("constructorWithReordering.kt")
|
||||
public void testConstructorWithReordering() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/enum/constructorWithReordering.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("deepInnerClassInEnumEntryClass.kt")
|
||||
public void testDeepInnerClassInEnumEntryClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/enum/deepInnerClassInEnumEntryClass.kt");
|
||||
|
||||
+5
@@ -9337,6 +9337,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/enum/companionObjectInEnum.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("constructorWithReordering.kt")
|
||||
public void testConstructorWithReordering() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/enum/constructorWithReordering.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("deepInnerClassInEnumEntryClass.kt")
|
||||
public void testDeepInnerClassInEnumEntryClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/enum/deepInnerClassInEnumEntryClass.kt");
|
||||
|
||||
Generated
+5
@@ -8112,6 +8112,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/enum/companionObjectInEnum.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("constructorWithReordering.kt")
|
||||
public void testConstructorWithReordering() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/enum/constructorWithReordering.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("deepInnerClassInEnumEntryClass.kt")
|
||||
public void testDeepInnerClassInEnumEntryClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/enum/deepInnerClassInEnumEntryClass.kt");
|
||||
|
||||
+5
@@ -9187,6 +9187,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/enum/companionObjectInEnum.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("constructorWithReordering.kt")
|
||||
public void testConstructorWithReordering() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/enum/constructorWithReordering.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("deepInnerClassInEnumEntryClass.kt")
|
||||
public void testDeepInnerClassInEnumEntryClass() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/enum/deepInnerClassInEnumEntryClass.kt");
|
||||
|
||||
Reference in New Issue
Block a user