[FIR] Don't create delegating super constructor call to kotlin.Enum for enums

This commit is contained in:
Dmitriy Novozhilov
2019-12-05 12:30:49 +03:00
parent a0d8e5bde7
commit d840671620
23 changed files with 84 additions and 83 deletions
@@ -387,9 +387,9 @@ class DeclarationsConverter(
val selfType = null.toDelegatedSelfType(firClass)
val defaultDelegatedSuperTypeRef = when {
modifiers.isEnum() && (classKind == ClassKind.ENUM_CLASS) ->
FirResolvedTypeRefImpl(
when {
modifiers.isEnum() && (classKind == ClassKind.ENUM_CLASS) -> {
superTypeRefs += FirResolvedTypeRefImpl(
source = null,
ConeClassLikeTypeImpl(
implicitEnumType.type.lookupTag,
@@ -397,12 +397,12 @@ class DeclarationsConverter(
isNullable = false
)
)
}
modifiers.isAnnotation() && (classKind == ClassKind.ANNOTATION_CLASS) -> {
superTypeRefs += implicitAnnotationType
implicitAnyType
}
else -> implicitAnyType
}
val defaultDelegatedSuperTypeRef = implicitAnyType
superTypeRefs.ifEmpty { superTypeRefs += defaultDelegatedSuperTypeRef }
@@ -25,6 +25,7 @@ import org.jetbrains.kotlin.fir.symbols.CallableId
import org.jetbrains.kotlin.fir.symbols.impl.*
import org.jetbrains.kotlin.fir.types.*
import org.jetbrains.kotlin.fir.types.impl.*
import org.jetbrains.kotlin.ir.expressions.IrConstKind
import org.jetbrains.kotlin.lexer.KtTokens.*
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.Name
@@ -343,22 +344,29 @@ class RawFirBuilder(session: FirSession, val stubMode: Boolean) : BaseFirBuilder
}
}
val defaultDelegatedSuperTypeRef = when {
this is KtClass && classKind == ClassKind.ENUM_CLASS -> FirResolvedTypeRefImpl(
null,
ConeClassLikeTypeImpl(
implicitEnumType.type.lookupTag,
delegatedSelfTypeRef?.coneTypeUnsafe<ConeKotlinType>()?.let { arrayOf(it) } ?: emptyArray(),
isNullable = false
when {
this is KtClass && classKind == ClassKind.ENUM_CLASS -> {
/*
* kotlin.Enum constructor has (name: String, ordinal: Int) signature,
* so we should generate non-trivial constructors for enum and it's entry
* for correct resolve of super constructor call or just call kotlin.Any constructor
* and convert it to right call at backend, because of it doesn't affects frontend work
*/
container.superTypeRefs += FirResolvedTypeRefImpl(
null,
ConeClassLikeTypeImpl(
implicitEnumType.type.lookupTag,
delegatedSelfTypeRef?.coneTypeUnsafe<ConeKotlinType>()?.let { arrayOf(it) } ?: emptyArray(),
isNullable = false
)
)
)
}
this is KtClass && classKind == ClassKind.ANNOTATION_CLASS -> {
container.superTypeRefs += implicitAnnotationType
implicitAnyType
}
else -> implicitAnyType
}
// TODO: for enum / annotations, it *should* be empty
val defaultDelegatedSuperTypeRef = implicitAnyType
if (container.superTypeRefs.isEmpty()) {
container.superTypeRefs += defaultDelegatedSuperTypeRef
}
@@ -1,7 +1,7 @@
FILE: enums.kt
public? final? enum class Order : R|kotlin/Enum<Order>| {
private constructor(): R|Order| {
super<R|kotlin/Enum<Order>|>()
super<R|kotlin/Any|>()
}
public? final enum entry FIRST : R|kotlin/Any| {
@@ -34,7 +34,7 @@ FILE: enums.kt
}
public? final? enum class Planet : R|kotlin/Enum<Planet>| {
public? constructor(m: Double, r: Double): R|Planet| {
super<R|kotlin/Enum<Planet>|>()
super<R|kotlin/Any|>()
}
public? final? val m: Double = R|<local>/m|
@@ -15,7 +15,7 @@ FILE: enums2.kt
}
public? final? enum class SomeEnum : R|kotlin/Enum<SomeEnum>| {
public? constructor(x: Some): R|SomeEnum| {
super<R|kotlin/Enum<SomeEnum>|>()
super<R|kotlin/Any|>()
}
public? final? val x: Some = R|<local>/x|
+1 -1
View File
@@ -15,7 +15,7 @@ FILE: enum.kt
}
public final enum class SomeEnum : R|kotlin/Enum<SomeEnum>| {
private constructor(x: R|Some|): R|SomeEnum| {
super<R|kotlin/Enum<SomeEnum>|>()
super<R|kotlin/Any|>()
}
public final val x: R|Some| = R|<local>/x|
@@ -1,7 +1,7 @@
FILE: exhaustiveness_enum.kt
public final enum class Enum : R|kotlin/Enum<Enum>| {
private constructor(): R|Enum| {
super<R|kotlin/Enum<Enum>|>()
super<R|kotlin/Any|>()
}
public final enum entry A : R|kotlin/Any| {
@@ -1,7 +1,7 @@
FILE: enumValues.kt
public final enum class MyEnum : R|kotlin/Enum<MyEnum>| {
private constructor(): R|MyEnum| {
super<R|kotlin/Enum<MyEnum>|>()
super<R|kotlin/Any|>()
}
public final enum entry FIRST : R|kotlin/Any| {
@@ -30,7 +30,7 @@ FILE: qualifiedExpressions.kt
}
public final enum class E : R|kotlin/Enum<a/b/E>| {
private constructor(): R|a/b/E| {
super<R|kotlin/Enum<a/b/E>|>()
super<R|kotlin/Any|>()
}
public final enum entry entry : R|kotlin/Any| {
@@ -1,7 +1,7 @@
FILE: enums.kt
public final enum class Order : R|kotlin/Enum<Order>| {
private constructor(): R|Order| {
super<R|kotlin/Enum<Order>|>()
super<R|kotlin/Any|>()
}
public final enum entry FIRST : R|kotlin/Any| {
@@ -34,7 +34,7 @@ FILE: enums.kt
}
public final enum class Planet : R|kotlin/Enum<Planet>| {
private constructor(m: R|kotlin/Double|, r: R|kotlin/Double|): R|Planet| {
super<R|kotlin/Enum<Planet>|>()
super<R|kotlin/Any|>()
}
public final val m: R|kotlin/Double| = R|<local>/m|
+1 -2
View File
@@ -72,8 +72,7 @@ FILE fqName:<root> fileName:/classes.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnumClass
CONSTRUCTOR visibility:private <> () returnType:<root>.TestEnumClass [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <none>
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnumClass modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestEnumClass>]'
FUN name:values visibility:public modality:FINAL <> ($this:<root>.TestEnumClass) returnType:kotlin.Array<<root>.TestEnumClass>
$this: VALUE_PARAMETER name:<this> type:<root>.TestEnumClass
+6 -12
View File
@@ -3,8 +3,7 @@ FILE fqName:<root> fileName:/enum.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum1
CONSTRUCTOR visibility:private <> () returnType:<root>.TestEnum1 [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <none>
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestEnum1>]'
CLASS ENUM_ENTRY name:TEST1 modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum1.TEST1
@@ -90,8 +89,7 @@ FILE fqName:<root> fileName:/enum.kt
CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:<root>.TestEnum2 [primary]
VALUE_PARAMETER name:x index:0 type:kotlin.Int
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <none>
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestEnum2>]'
PROPERTY name:x visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]
@@ -317,8 +315,7 @@ FILE fqName:<root> fileName:/enum.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum3
CONSTRUCTOR visibility:private <> () returnType:<root>.TestEnum3 [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <none>
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum3 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestEnum3>]'
CLASS ENUM_ENTRY name:TEST modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum3.TEST
@@ -392,8 +389,7 @@ FILE fqName:<root> fileName:/enum.kt
CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:<root>.TestEnum4 [primary]
VALUE_PARAMETER name:x index:0 type:kotlin.Int
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <none>
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum4 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestEnum4>]'
PROPERTY name:x visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]
@@ -593,8 +589,7 @@ FILE fqName:<root> fileName:/enum.kt
EXPRESSION_BODY
CONST Int type=kotlin.Int value=0
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <none>
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum5 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestEnum5>]'
PROPERTY name:x visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]
@@ -788,8 +783,7 @@ FILE fqName:<root> fileName:/enum.kt
VALUE_PARAMETER name:x index:0 type:kotlin.Int
VALUE_PARAMETER name:y index:1 type:kotlin.Int
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <none>
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
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]
+30 -16
View File
@@ -3,8 +3,7 @@ FILE fqName:<root> fileName:/enumClassModality.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestFinalEnum1
CONSTRUCTOR visibility:private <> () returnType:<root>.TestFinalEnum1 [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <none>
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestFinalEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestFinalEnum1>]'
CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestFinalEnum1.X1
@@ -71,8 +70,7 @@ FILE fqName:<root> fileName:/enumClassModality.kt
CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:<root>.TestFinalEnum2 [primary]
VALUE_PARAMETER name:x index:0 type:kotlin.Int
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <none>
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestFinalEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestFinalEnum2>]'
PROPERTY name:x visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]
@@ -186,8 +184,7 @@ FILE fqName:<root> fileName:/enumClassModality.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestFinalEnum3
CONSTRUCTOR visibility:private <> () returnType:<root>.TestFinalEnum3 [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <none>
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestFinalEnum3 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestFinalEnum3>]'
CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestFinalEnum3.X1
@@ -256,8 +253,7 @@ FILE fqName:<root> fileName:/enumClassModality.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestOpenEnum1
CONSTRUCTOR visibility:private <> () returnType:<root>.TestOpenEnum1 [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <none>
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestOpenEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestOpenEnum1>]'
CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestOpenEnum1.X1
@@ -324,8 +320,7 @@ FILE fqName:<root> fileName:/enumClassModality.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestOpenEnum2
CONSTRUCTOR visibility:private <> () returnType:<root>.TestOpenEnum2 [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <none>
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestOpenEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestOpenEnum2>]'
CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestOpenEnum2.X1
@@ -397,8 +392,7 @@ FILE fqName:<root> fileName:/enumClassModality.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestAbstractEnum1
CONSTRUCTOR visibility:private <> () returnType:<root>.TestAbstractEnum1 [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <none>
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestAbstractEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestAbstractEnum1>]'
CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestAbstractEnum1.X1
@@ -482,13 +476,12 @@ FILE fqName:<root> fileName:/enumClassModality.kt
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS ENUM_CLASS name:TestAbstractEnum2 modality:FINAL visibility:public superTypes:[<root>.IFoo]
CLASS ENUM_CLASS name:TestAbstractEnum2 modality:FINAL visibility:public superTypes:[<root>.IFoo; kotlin.Enum<<root>.TestAbstractEnum2>]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestAbstractEnum2
CONSTRUCTOR visibility:private <> () returnType:<root>.TestAbstractEnum2 [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <none>
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestAbstractEnum2 modality:FINAL visibility:public superTypes:[<root>.IFoo]'
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestAbstractEnum2 modality:FINAL visibility:public superTypes:[<root>.IFoo; kotlin.Enum<<root>.TestAbstractEnum2>]'
CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestAbstractEnum2.X1
CONSTRUCTOR visibility:public <> () returnType:<root>.TestAbstractEnum2.X1 [primary]
@@ -535,3 +528,24 @@ FILE fqName:<root> fileName:/enumClassModality.kt
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any [fake_override]
overridden:
protected final fun clone (): kotlin.Any declared in kotlin.Enum
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum
FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum, other:<root>.TestAbstractEnum2) returnType:kotlin.Int [fake_override,operator]
overridden:
public final fun compareTo (other: E of kotlin.Enum): kotlin.Int [operator] declared in kotlin.Enum
$this: VALUE_PARAMETER name:<this> type:kotlin.Enum
VALUE_PARAMETER name:other index:0 type:<root>.TestAbstractEnum2
PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val]
FUN FAKE_OVERRIDE name:<get-name> visibility:public modality:FINAL <> ($this:<root>.TestAbstractEnum2) 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:<root>.TestAbstractEnum2
PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val]
FUN FAKE_OVERRIDE name:<get-ordinal> visibility:public modality:FINAL <> ($this:<root>.TestAbstractEnum2) 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:<root>.TestAbstractEnum2
@@ -4,8 +4,7 @@ FILE fqName:<root> fileName:/enumWithSecondaryCtor.kt
CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:<root>.Test0 [primary]
VALUE_PARAMETER name:x index:0 type:kotlin.Int
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <none>
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Test0 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.Test0>]'
PROPERTY name:x visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]
@@ -87,8 +86,7 @@ FILE fqName:<root> fileName:/enumWithSecondaryCtor.kt
CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:<root>.Test1 [primary]
VALUE_PARAMETER name:x index:0 type:kotlin.Int
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <none>
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.Test1>]'
PROPERTY name:x visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]
@@ -226,8 +224,7 @@ FILE fqName:<root> fileName:/enumWithSecondaryCtor.kt
CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:<root>.Test2 [primary]
VALUE_PARAMETER name:x index:0 type:kotlin.Int
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <none>
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Test2 modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.Test2>]'
PROPERTY name:x visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]
@@ -132,8 +132,7 @@ FILE fqName:<root> fileName:/classesWithAnnotations.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum
CONSTRUCTOR visibility:private <> () returnType:<root>.TestEnum [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <none>
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestEnum>]'
FUN name:values visibility:public modality:FINAL <> ($this:<root>.TestEnum) returnType:kotlin.Array<<root>.TestEnum>
$this: VALUE_PARAMETER name:<this> type:<root>.TestEnum
@@ -31,8 +31,7 @@ FILE fqName:<root> fileName:/enumEntriesWithAnnotations.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum
CONSTRUCTOR visibility:private <> () returnType:<root>.TestEnum [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <none>
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:TestEnum modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.TestEnum>]'
CLASS ENUM_ENTRY name:ENTRY1 modality:FINAL visibility:public superTypes:[kotlin.Any]
annotations:
@@ -3,8 +3,7 @@ FILE fqName:<root> fileName:/enumsInAnnotationArguments.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.En
CONSTRUCTOR visibility:private <> () returnType:<root>.En [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <none>
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.En>]'
CLASS ENUM_ENTRY name:A modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.En.A
@@ -3,8 +3,7 @@ FILE fqName:<root> fileName:/expectedEnumClass.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.MyEnum
CONSTRUCTOR visibility:private <> () returnType:<root>.MyEnum [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <none>
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:MyEnum modality:FINAL visibility:public [expect] superTypes:[kotlin.Enum<<root>.MyEnum>]'
CLASS ENUM_ENTRY name:FOO modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.MyEnum.FOO
@@ -89,8 +88,7 @@ FILE fqName:<root> fileName:/expectedEnumClass.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.MyEnum
CONSTRUCTOR visibility:private <> () returnType:<root>.MyEnum [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <none>
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>]'
CLASS ENUM_ENTRY name:FOO modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.MyEnum.FOO
@@ -3,8 +3,7 @@ FILE fqName:<root> fileName:/enumEntryAsReceiver.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.X
CONSTRUCTOR visibility:private <> () returnType:<root>.X [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <none>
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:X modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.X>]'
CLASS ENUM_ENTRY name:B modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.X.B
@@ -3,8 +3,7 @@ FILE fqName:<root> fileName:/enumEntryReferenceFromEnumEntryClass.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.MyEnum
CONSTRUCTOR visibility:private <> () returnType:<root>.MyEnum [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <none>
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>]'
CLASS ENUM_ENTRY name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.MyEnum.Z
@@ -22,8 +22,7 @@ FILE fqName:<root> fileName:/objectAsCallable.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.En
CONSTRUCTOR visibility:private <> () returnType:<root>.En [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <none>
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.En>]'
CLASS ENUM_ENTRY name:X modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.En.X
@@ -13,8 +13,7 @@ FILE fqName:<root> fileName:/temporaryInEnumEntryInitializer.kt
CONSTRUCTOR visibility:private <> (x:kotlin.String?) returnType:<root>.En [primary]
VALUE_PARAMETER name:x index:0 type:kotlin.String?
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <none>
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:En modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.En>]'
PROPERTY name:x visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String? visibility:private [final]
+1 -2
View File
@@ -3,8 +3,7 @@ FILE fqName:<root> fileName:/values.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Enum
CONSTRUCTOR visibility:private <> () returnType:<root>.Enum [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <none>
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Enum modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.Enum>]'
CLASS ENUM_ENTRY name:A modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Enum.A
+1 -2
View File
@@ -3,8 +3,7 @@ FILE fqName:<root> fileName:/enumEntry.kt
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Z
CONSTRUCTOR visibility:private <> () returnType:<root>.Z [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum'
<E>: <none>
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Z modality:FINAL visibility:public superTypes:[kotlin.Enum<<root>.Z>]'
CLASS ENUM_ENTRY name:ENTRY modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Z.ENTRY