[FIR] Allow nullable receiver type in case of safe-calls

This commit is contained in:
Simon Ogorodnik
2019-05-15 15:53:07 +03:00
committed by Mikhail Glukhikh
parent b28207deca
commit 27a1ec3817
12 changed files with 92 additions and 37 deletions
@@ -32,6 +32,7 @@ fun resolveArgumentExpression(
expectedTypeRef: FirTypeRef, expectedTypeRef: FirTypeRef,
sink: CheckerSink, sink: CheckerSink,
isReceiver: Boolean, isReceiver: Boolean,
isSafeCall: Boolean,
acceptLambdaAtoms: (PostponedResolvedAtomMarker) -> Unit, acceptLambdaAtoms: (PostponedResolvedAtomMarker) -> Unit,
typeProvider: (FirExpression) -> FirTypeRef? typeProvider: (FirExpression) -> FirTypeRef?
) { ) {
@@ -42,6 +43,7 @@ fun resolveArgumentExpression(
expectedType, expectedType,
sink, sink,
isReceiver, isReceiver,
isSafeCall,
typeProvider typeProvider
) )
// TODO:! // TODO:!
@@ -57,6 +59,7 @@ fun resolveArgumentExpression(
expectedTypeRef, expectedTypeRef,
sink, sink,
isReceiver, isReceiver,
isSafeCall,
acceptLambdaAtoms, acceptLambdaAtoms,
typeProvider typeProvider
) )
@@ -67,10 +70,11 @@ fun resolveArgumentExpression(
expectedTypeRef, expectedTypeRef,
sink, sink,
isReceiver, isReceiver,
isSafeCall,
acceptLambdaAtoms, acceptLambdaAtoms,
typeProvider typeProvider
) )
else -> resolvePlainExpressionArgument(csBuilder, argument, expectedType, sink, isReceiver, typeProvider) else -> resolvePlainExpressionArgument(csBuilder, argument, expectedType, sink, isReceiver, isSafeCall, typeProvider)
} }
} }
@@ -80,11 +84,12 @@ fun resolvePlainExpressionArgument(
expectedType: ConeKotlinType?, expectedType: ConeKotlinType?,
sink: CheckerSink, sink: CheckerSink,
isReceiver: Boolean, isReceiver: Boolean,
isSafeCall: Boolean,
typeProvider: (FirExpression) -> FirTypeRef? typeProvider: (FirExpression) -> FirTypeRef?
) { ) {
if (expectedType == null) return if (expectedType == null) return
val argumentType = typeProvider(argument)?.coneTypeSafe<ConeKotlinType>() ?: return val argumentType = typeProvider(argument)?.coneTypeSafe<ConeKotlinType>() ?: return
resolvePlainArgumentType(csBuilder, argumentType, expectedType, sink, isReceiver) resolvePlainArgumentType(csBuilder, argumentType, expectedType, sink, isReceiver, isSafeCall)
} }
fun resolvePlainArgumentType( fun resolvePlainArgumentType(
@@ -92,12 +97,20 @@ fun resolvePlainArgumentType(
argumentType: ConeKotlinType, argumentType: ConeKotlinType,
expectedType: ConeKotlinType, expectedType: ConeKotlinType,
sink: CheckerSink, sink: CheckerSink,
isReceiver: Boolean isReceiver: Boolean,
isSafeCall: Boolean
) { ) {
val position = SimpleConstraintSystemConstraintPosition //TODO val position = SimpleConstraintSystemConstraintPosition //TODO
val nullableExpectedType = expectedType.withNullability(ConeNullability.NULLABLE)
if (isReceiver && isSafeCall) {
if (!csBuilder.addSubtypeConstraintIfCompatible(argumentType, nullableExpectedType, position)) {
sink.reportApplicability(CandidateApplicability.WRONG_RECEIVER) // TODO
}
return
}
if (!csBuilder.addSubtypeConstraintIfCompatible(argumentType, expectedType, position)) { if (!csBuilder.addSubtypeConstraintIfCompatible(argumentType, expectedType, position)) {
val nullableExpectedType = expectedType.withNullability(ConeNullability.NULLABLE)
if (!isReceiver) { if (!isReceiver) {
if (!csBuilder.addSubtypeConstraintIfCompatible(argumentType, nullableExpectedType, position)) { if (!csBuilder.addSubtypeConstraintIfCompatible(argumentType, nullableExpectedType, position)) {
csBuilder.addSubtypeConstraint(argumentType, expectedType, position) csBuilder.addSubtypeConstraint(argumentType, expectedType, position)
@@ -119,6 +132,7 @@ internal fun Candidate.resolveArgument(
argument: FirExpression, argument: FirExpression,
parameter: FirValueParameter, parameter: FirValueParameter,
isReceiver: Boolean, isReceiver: Boolean,
isSafeCall: Boolean,
typeProvider: (FirExpression) -> FirTypeRef?, typeProvider: (FirExpression) -> FirTypeRef?,
sink: CheckerSink sink: CheckerSink
) { ) {
@@ -131,6 +145,7 @@ internal fun Candidate.resolveArgument(
parameter.returnTypeRef, parameter.returnTypeRef,
sink, sink,
isReceiver, isReceiver,
isSafeCall,
{ this.postponedAtoms += it }, { this.postponedAtoms += it },
typeProvider typeProvider
) )
@@ -36,6 +36,7 @@ class CallInfo(
val explicitReceiver: FirExpression?, val explicitReceiver: FirExpression?,
val arguments: List<FirExpression>, val arguments: List<FirExpression>,
val isSafeCall: Boolean,
val typeArguments: List<FirTypeProjection>, val typeArguments: List<FirTypeProjection>,
val session: FirSession, val session: FirSession,
@@ -109,6 +109,7 @@ class PostponedArgumentsAnalyzer(
lambda.atom.returnTypeRef, // TODO: proper ref lambda.atom.returnTypeRef, // TODO: proper ref
checkerSink, checkerSink,
false, false,
false,
{ atom = it }, { atom = it },
typeProvider typeProvider
) )
@@ -103,10 +103,15 @@ internal sealed class CheckReceivers : ResolutionStage() {
if (receiverParameterValue != null) { if (receiverParameterValue != null) {
if (explicitReceiverExpression != null && explicitReceiverKind.shouldBeResolvedAsExplicit()) { if (explicitReceiverExpression != null && explicitReceiverKind.shouldBeResolvedAsExplicit()) {
resolveArgumentExpression( resolveArgumentExpression(
candidate.csBuilder, explicitReceiverExpression, candidate.csBuilder,
explicitReceiverExpression,
candidate.substitutor.substituteOrSelf(receiverParameterValue.type), candidate.substitutor.substituteOrSelf(receiverParameterValue.type),
explicitReceiverExpression.typeRef, explicitReceiverExpression.typeRef,
sink, isReceiver = true, typeProvider = callInfo.typeProvider, acceptLambdaAtoms = { candidate.postponedAtoms += it } sink,
isReceiver = true,
isSafeCall = callInfo.isSafeCall,
typeProvider = callInfo.typeProvider,
acceptLambdaAtoms = { candidate.postponedAtoms += it }
) )
} }
} }
@@ -132,7 +137,14 @@ internal object CheckArguments : CheckerStage() {
val argumentMapping = val argumentMapping =
candidate.argumentMapping ?: throw IllegalStateException("Argument should be already mapped while checking arguments!") candidate.argumentMapping ?: throw IllegalStateException("Argument should be already mapped while checking arguments!")
for ((argument, parameter) in argumentMapping) { for ((argument, parameter) in argumentMapping) {
candidate.resolveArgument(argument, parameter, isReceiver = false, typeProvider = callInfo.typeProvider, sink = sink) candidate.resolveArgument(
argument,
parameter,
isReceiver = false,
isSafeCall = false,
typeProvider = callInfo.typeProvider,
sink = sink
)
} }
if (candidate.system.hasContradiction) { if (candidate.system.hasContradiction) {
@@ -248,7 +248,16 @@ open class FirBodyResolveTransformer(val session: FirSession, val implicitTypeOn
val receiver = qualifiedAccess.explicitReceiver?.transformSingle(this, noExpectedType) val receiver = qualifiedAccess.explicitReceiver?.transformSingle(this, noExpectedType)
val info = CallInfo(CallKind.VariableAccess, receiver, emptyList(), emptyList(), session, file, container!!) { it.resultType } val info = CallInfo(
CallKind.VariableAccess,
receiver,
emptyList(),
qualifiedAccess.safe,
emptyList(),
session,
file,
container!!
) { it.resultType }
val resolver = CallResolver(jump, inferenceComponents) val resolver = CallResolver(jump, inferenceComponents)
resolver.callInfo = info resolver.callInfo = info
resolver.scopes = (scopes + localScopes).asReversed() resolver.scopes = (scopes + localScopes).asReversed()
@@ -358,7 +367,16 @@ open class FirBodyResolveTransformer(val session: FirSession, val implicitTypeOn
val arguments = functionCall.arguments val arguments = functionCall.arguments
val typeArguments = functionCall.typeArguments val typeArguments = functionCall.typeArguments
val info = CallInfo(CallKind.Function, explicitReceiver, arguments, typeArguments, session, file, container!!) { it.resultType } val info = CallInfo(
CallKind.Function,
explicitReceiver,
arguments,
functionCall.safe,
typeArguments,
session,
file,
container!!
) { it.resultType }
val resolver = CallResolver(jump, inferenceComponents) val resolver = CallResolver(jump, inferenceComponents)
resolver.callInfo = info resolver.callInfo = info
resolver.scopes = (scopes + localScopes).asReversed() resolver.scopes = (scopes + localScopes).asReversed()
+9 -9
View File
@@ -16,21 +16,21 @@ FILE fqName:<root> fileName:/bangbang.kt
BRANCH BRANCH
if: CONST Boolean type=kotlin.Boolean value=true if: CONST Boolean type=kotlin.Boolean value=true
then: GET_VAR 'val <bangbang>: kotlin.Any? [val] declared in <root>.test1' type=kotlin.Any? origin=null then: GET_VAR 'val <bangbang>: kotlin.Any? [val] declared in <root>.test1' type=kotlin.Any? origin=null
FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.Any?) returnType:IrErrorType FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.Any?) returnType:kotlin.Int
VALUE_PARAMETER name:a index:0 type:kotlin.Any? VALUE_PARAMETER name:a index:0 type:kotlin.Any?
BLOCK_BODY BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test2 (a: kotlin.Any?): IrErrorType declared in <root>' RETURN type=kotlin.Nothing from='public final fun test2 (a: kotlin.Any?): kotlin.Int declared in <root>'
BLOCK type=IrErrorType origin=EXCLEXCL BLOCK type=kotlin.Int origin=EXCLEXCL
VAR name:<bangbang> type:IrErrorType [val] VAR name:<bangbang> type:kotlin.Int [val]
ERROR_CALL 'Unresolved reference: <Inapplicable(WRONG_RECEIVER): [kotlin/Any.hashCode]>#' type=IrErrorType CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null
WHEN type=IrErrorType origin=EXCLEXCL $this: GET_VAR 'a: kotlin.Any? declared in <root>.test2' type=kotlin.Any? origin=null
WHEN type=kotlin.Int origin=EXCLEXCL
BRANCH BRANCH
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'val <bangbang>: IrErrorType [val] declared in <root>.test2' type=IrErrorType origin=null arg0: GET_VAR 'val <bangbang>: kotlin.Int [val] declared in <root>.test2' type=kotlin.Int origin=null
arg1: CONST Null type=kotlin.Nothing? value=null arg1: CONST Null type=kotlin.Nothing? value=null
then: THROW type=kotlin.Nothing then: THROW type=kotlin.Nothing
ERROR_CALL 'Unresolved reference: <Unresolved name: KotlinNullPointerException>#' type=IrErrorType ERROR_CALL 'Unresolved reference: <Unresolved name: KotlinNullPointerException>#' type=IrErrorType
BRANCH BRANCH
if: CONST Boolean type=kotlin.Boolean value=true if: CONST Boolean type=kotlin.Boolean value=true
then: GET_VAR 'val <bangbang>: IrErrorType [val] declared in <root>.test2' type=IrErrorType origin=null then: GET_VAR 'val <bangbang>: kotlin.Int [val] declared in <root>.test2' type=kotlin.Int origin=null
@@ -28,9 +28,12 @@ FILE fqName:<root> fileName:/chainOfSafeCalls.kt
overridden: overridden:
public open fun toString (): kotlin.String declared in kotlin.Any public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any $this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:test visibility:public modality:FINAL <> (nc:<root>.C?) returnType:IrErrorType FUN name:test visibility:public modality:FINAL <> (nc:<root>.C?) returnType:<root>.C
VALUE_PARAMETER name:nc index:0 type:<root>.C? VALUE_PARAMETER name:nc index:0 type:<root>.C?
BLOCK_BODY BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test (nc: <root>.C?): IrErrorType declared in <root>' RETURN type=kotlin.Nothing from='public final fun test (nc: <root>.C?): <root>.C declared in <root>'
ERROR_CALL 'Unresolved reference: <Unresolved name: foo>#' type=IrErrorType CALL 'public final fun foo (): <root>.C declared in <root>.C' type=<root>.C origin=null
$this: CALL 'public final fun foo (): <root>.C declared in <root>.C' type=<root>.C origin=null
$this: CALL 'public final fun bar (): <root>.C? declared in <root>.C' type=<root>.C? origin=null
$this: CALL 'public final fun foo (): <root>.C declared in <root>.C' type=<root>.C origin=null
$this: GET_VAR 'nc: <root>.C? declared in <root>.test' type=<root>.C? origin=null
+8 -7
View File
@@ -55,20 +55,21 @@ FILE fqName:<root> fileName:/kt30020.kt
if: CONST Boolean type=kotlin.Boolean value=true if: CONST Boolean type=kotlin.Boolean value=true
then: GET_VAR 'val <bangbang>: kotlin.collections.MutableList<kotlin.Any> [val] declared in <root>.test' type=kotlin.collections.MutableList<kotlin.Any> origin=null then: GET_VAR 'val <bangbang>: kotlin.collections.MutableList<kotlin.Any> [val] declared in <root>.test' type=kotlin.collections.MutableList<kotlin.Any> origin=null
ERROR_CALL 'Unresolved reference: R|<local>/<complex-set>|' type=IrErrorType ERROR_CALL 'Unresolved reference: R|<local>/<complex-set>|' type=IrErrorType
VAR name:<complex-set> type:IrErrorType [val] VAR name:<complex-set> type:kotlin.collections.MutableList<kotlin.Any> [val]
BLOCK type=IrErrorType origin=EXCLEXCL BLOCK type=kotlin.collections.MutableList<kotlin.Any> origin=EXCLEXCL
VAR name:<bangbang> type:IrErrorType [val] VAR name:<bangbang> type:kotlin.collections.MutableList<kotlin.Any> [val]
ERROR_CALL 'Unresolved reference: <Inapplicable(WRONG_RECEIVER): [/X.f]>#' type=IrErrorType CALL 'public abstract fun f (): kotlin.collections.MutableList<kotlin.Any> declared in <root>.X' type=kotlin.collections.MutableList<kotlin.Any> origin=null
WHEN type=IrErrorType origin=EXCLEXCL $this: GET_VAR 'nx: <root>.X? declared in <root>.test' type=<root>.X? origin=null
WHEN type=kotlin.collections.MutableList<kotlin.Any> origin=EXCLEXCL
BRANCH BRANCH
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'val <bangbang>: IrErrorType [val] declared in <root>.test' type=IrErrorType origin=null arg0: GET_VAR 'val <bangbang>: kotlin.collections.MutableList<kotlin.Any> [val] declared in <root>.test' type=kotlin.collections.MutableList<kotlin.Any> origin=null
arg1: CONST Null type=kotlin.Nothing? value=null arg1: CONST Null type=kotlin.Nothing? value=null
then: THROW type=kotlin.Nothing then: THROW type=kotlin.Nothing
CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.KotlinNullPointerException' type=kotlin.KotlinNullPointerException origin=null CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.KotlinNullPointerException' type=kotlin.KotlinNullPointerException origin=null
BRANCH BRANCH
if: CONST Boolean type=kotlin.Boolean value=true if: CONST Boolean type=kotlin.Boolean value=true
then: GET_VAR 'val <bangbang>: IrErrorType [val] declared in <root>.test' type=IrErrorType origin=null then: GET_VAR 'val <bangbang>: kotlin.collections.MutableList<kotlin.Any> [val] declared in <root>.test' type=kotlin.collections.MutableList<kotlin.Any> origin=null
ERROR_CALL 'Unresolved reference: R|<local>/<complex-set>|' type=IrErrorType ERROR_CALL 'Unresolved reference: R|<local>/<complex-set>|' type=IrErrorType
FUN name:testExtensionReceiver visibility:public modality:FINAL <> () returnType:kotlin.Unit FUN name:testExtensionReceiver visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY BLOCK_BODY
@@ -31,7 +31,8 @@ FILE fqName:test fileName:/safeCallWithIncrementDecrement.kt
FUN name:inc visibility:public modality:FINAL <> () returnType:kotlin.Int? FUN name:inc visibility:public modality:FINAL <> () returnType:kotlin.Int?
BLOCK_BODY BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun inc (): kotlin.Int? declared in test' RETURN type=kotlin.Nothing from='public final fun inc (): kotlin.Int? declared in test'
CALL 'public final fun inc (): kotlin.Int? declared in test' type=kotlin.Int? origin=null CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
$this: ERROR_CALL 'Unresolved reference: this#' type=kotlin.Int?
FUN name:get visibility:public modality:FINAL <> (index:kotlin.Int) returnType:kotlin.Int FUN name:get visibility:public modality:FINAL <> (index:kotlin.Int) returnType:kotlin.Int
VALUE_PARAMETER name:index index:0 type:kotlin.Int VALUE_PARAMETER name:index index:0 type:kotlin.Int
BLOCK_BODY BLOCK_BODY
+6 -5
View File
@@ -67,24 +67,25 @@ FILE fqName:<root> fileName:/safeCalls.kt
VALUE_PARAMETER name:x index:0 type:kotlin.String? VALUE_PARAMETER name:x index:0 type:kotlin.String?
BLOCK_BODY BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test2 (x: kotlin.String?): IrErrorType declared in <root>' RETURN type=kotlin.Nothing from='public final fun test2 (x: kotlin.String?): IrErrorType declared in <root>'
ERROR_CALL 'Unresolved reference: <Inapplicable(WRONG_RECEIVER): [kotlin/Any.hashCode, kotlin/Any.hashCode]>#' type=IrErrorType ERROR_CALL 'Unresolved reference: <Ambiguity: hashCode, [kotlin/Any.hashCode, kotlin/Any.hashCode]>#' type=IrErrorType
FUN name:test3 visibility:public modality:FINAL <> (x:kotlin.String?, y:kotlin.Any?) returnType:IrErrorType FUN name:test3 visibility:public modality:FINAL <> (x:kotlin.String?, y:kotlin.Any?) returnType:IrErrorType
VALUE_PARAMETER name:x index:0 type:kotlin.String? VALUE_PARAMETER name:x index:0 type:kotlin.String?
VALUE_PARAMETER name:y index:1 type:kotlin.Any? VALUE_PARAMETER name:y index:1 type:kotlin.Any?
BLOCK_BODY BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test3 (x: kotlin.String?, y: kotlin.Any?): IrErrorType declared in <root>' RETURN type=kotlin.Nothing from='public final fun test3 (x: kotlin.String?, y: kotlin.Any?): IrErrorType declared in <root>'
ERROR_CALL 'Unresolved reference: <Inapplicable(WRONG_RECEIVER): [kotlin/Any.equals, kotlin/Any.equals]>#' type=IrErrorType ERROR_CALL 'Unresolved reference: <Ambiguity: equals, [kotlin/Any.equals, kotlin/Any.equals]>#' type=IrErrorType
GET_VAR 'y: kotlin.Any? declared in <root>.test3' type=kotlin.Any? origin=null GET_VAR 'y: kotlin.Any? declared in <root>.test3' type=kotlin.Any? origin=null
FUN name:test4 visibility:public modality:FINAL <> (x:<root>.Ref?) returnType:kotlin.Unit FUN name:test4 visibility:public modality:FINAL <> (x:<root>.Ref?) returnType:kotlin.Unit
VALUE_PARAMETER name:x index:0 type:<root>.Ref? VALUE_PARAMETER name:x index:0 type:<root>.Ref?
BLOCK_BODY BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:public ' type=kotlin.Int origin=null SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:public ' type=kotlin.Int origin=null
value: CONST Int type=kotlin.Int value=0 value: CONST Int type=kotlin.Int value=0
FUN name:test5 visibility:public modality:FINAL <> (s:kotlin.String?) returnType:IrErrorType FUN name:test5 visibility:public modality:FINAL <> (s:kotlin.String?) returnType:kotlin.Int
VALUE_PARAMETER name:s index:0 type:kotlin.String? VALUE_PARAMETER name:s index:0 type:kotlin.String?
BLOCK_BODY BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test5 (s: kotlin.String?): IrErrorType declared in <root>' RETURN type=kotlin.Nothing from='public final fun test5 (s: kotlin.String?): kotlin.Int declared in <root>'
ERROR_CALL 'Unresolved reference: <Inapplicable(WRONG_RECEIVER): [/IHost.extLength]>#' type=IrErrorType CALL 'public open fun extLength (): kotlin.Int declared in <root>.IHost' type=kotlin.Int origin=null
$this: GET_VAR 's: kotlin.String? declared in <root>.test5' type=kotlin.String? origin=null
FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Int FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Int
BLOCK_BODY BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Int declared in <root>' RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.Int declared in <root>'
@@ -31,7 +31,8 @@ FILE fqName:<root> fileName:/temporaryInEnumEntryInitializer.kt
CONSTRUCTOR visibility:public <> () returnType:<root>.En.ENTRY [primary] CONSTRUCTOR visibility:public <> () returnType:<root>.En.ENTRY [primary]
BLOCK_BODY BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.String?) [primary] declared in <root>.En' DELEGATING_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.String?) [primary] declared in <root>.En'
x: CALL 'public final fun toString (): kotlin.String declared in kotlin' type=kotlin.String origin=null 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:public superTypes:[<root>.En]' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ENTRY modality:FINAL visibility:public superTypes:[<root>.En]'
FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any
overridden: overridden:
@@ -18,7 +18,8 @@ FILE fqName:<root> fileName:/temporaryInInitBlock.kt
ANONYMOUS_INITIALIZER isStatic=false ANONYMOUS_INITIALIZER isStatic=false
BLOCK_BODY BLOCK_BODY
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String? visibility:public [final] ' type=kotlin.String? origin=null SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String? visibility:public [final] ' type=kotlin.String? origin=null
value: CALL 'public final fun toString (): kotlin.String declared in kotlin' type=kotlin.String origin=null value: CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null
$this: GET_VAR 'x: kotlin.Any? declared in <root>.C.<init>' type=kotlin.Any? origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
overridden: overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any