From c0f8be5d4e62c173812f0b2adf1740391b14f10b Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Mon, 16 Mar 2020 15:33:11 +0300 Subject: [PATCH] [FIR2IR] Generate setter call for assignments, if any --- .../fir/backend/generators/CallGenerator.kt | 18 +- .../propertyAndFunctionNameClash.kt | 1 - .../provideDelegate/evaluationOrderVar.kt | 1 - .../box/delegatedProperty/topLevelVar.kt | 1 - .../inClassLongTypeInReceiver.kt | 1 - .../inClassWithPrivateSetter.kt | 1 - .../extensionProperties/inClassWithSetter.kt | 1 - .../topLevelLongTypeInReceiver.kt | 1 - .../box/fakeOverride/propertySetter.kt | 1 - .../coercionToUnitWithLastLambdaExpression.kt | 1 - .../codegen/box/intrinsics/prefixIncDec.kt | 1 - .../callsToMultifileClassFromOtherPackage.kt | 1 - .../codegen/box/operatorConventions/kt4152.kt | 1 - .../testData/codegen/box/properties/kt3551.kt | 1 - .../box/properties/lateinit/accessor.kt | 1 - .../call/cannotCallEnumConstructor.kt | 1 - .../enclosing/lambdaInPropertySetter.kt | 1 - .../codegen/box/statics/incInClassObject.kt | 1 - .../codegen/box/statics/incInObject.kt | 1 - .../codegen/box/typeMapping/kt3976.kt | 1 - .../ir/irText/classes/classMembers.fir.txt | 178 ------------------ .../ir/irText/classes/classMembers.kt | 1 + .../classes/enumWithMultipleCtors.fir.txt | 12 +- .../ir/irText/classes/initVar.fir.txt | 14 +- ...edPropertyAccessorsWithAnnotations.fir.txt | 6 +- .../ir/irText/expressions/assignments.fir.txt | 6 +- .../expressions/augmentedAssignment1.fir.txt | 20 +- .../complexAugmentedAssignment.fir.txt | 22 +-- ...umEntryReferenceFromEnumEntryClass.fir.txt | 24 +-- .../forWithImplicitReceivers.fir.txt | 6 +- .../expressions/genericPropertyRef.fir.txt | 8 +- .../expressions/incrementDecrement.fir.txt | 16 +- .../javaSyntheticPropertyAccess.fir.txt | 15 +- .../ir/irText/expressions/kt16904.fir.txt | 4 +- .../expressions/objectReference.fir.txt | 84 ++++----- .../irText/expressions/safeAssignment.fir.txt | 6 +- .../safeCallWithIncrementDecrement.fir.txt | 5 +- .../ir/irText/expressions/safeCalls.fir.txt | 6 +- .../expressions/useImportedMember.fir.txt | 6 +- .../regressions/integerCoercionToT.fir.txt | 6 +- .../genericPropertyReferenceType.fir.txt | 6 +- .../smartCastOnReceiverOfGenericType.fir.txt | 6 +- 42 files changed, 160 insertions(+), 334 deletions(-) delete mode 100644 compiler/testData/ir/irText/classes/classMembers.fir.txt diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallGenerator.kt index 16c7f63d253..db8a760a874 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallGenerator.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallGenerator.kt @@ -87,32 +87,34 @@ internal class CallGenerator( } fun convertToIrSetCall(variableAssignment: FirVariableAssignment): IrExpression { + val type = typeConverter.unitType val calleeReference = variableAssignment.calleeReference val symbol = calleeReference.toSymbol(session, classifierStorage, declarationStorage) return variableAssignment.convertWithOffsets { startOffset, endOffset -> if (symbol != null && symbol.isBound) { when (symbol) { is IrFieldSymbol -> IrSetFieldImpl( - startOffset, endOffset, symbol, typeConverter.unitType + startOffset, endOffset, symbol, type ).apply { value = visitor.convertToIrExpression(variableAssignment.rValue) } is IrPropertySymbol -> { val irProperty = symbol.owner + val setter = irProperty.setter val backingField = irProperty.backingField - if (backingField != null) { - IrSetFieldImpl( - startOffset, endOffset, backingField.symbol, typeConverter.unitType - ).apply { + when { + setter != null -> IrCallImpl(startOffset, endOffset, type, setter.symbol, origin = IrStatementOrigin.EQ).apply { + putValueArgument(0, visitor.convertToIrExpression(variableAssignment.rValue)) + } + backingField != null -> IrSetFieldImpl(startOffset, endOffset, backingField.symbol, type).apply { value = visitor.convertToIrExpression(variableAssignment.rValue) } - } else { - generateErrorCallExpression(startOffset, endOffset, calleeReference) + else -> generateErrorCallExpression(startOffset, endOffset, calleeReference) } } is IrVariableSymbol -> { IrSetVariableImpl( - startOffset, endOffset, irBuiltIns.unitType, symbol, + startOffset, endOffset, type, symbol, visitor.convertToIrExpression(variableAssignment.rValue), null ) } diff --git a/compiler/testData/codegen/box/closures/closureInsideClosure/propertyAndFunctionNameClash.kt b/compiler/testData/codegen/box/closures/closureInsideClosure/propertyAndFunctionNameClash.kt index c80bd49bcd5..9287967d5ea 100644 --- a/compiler/testData/codegen/box/closures/closureInsideClosure/propertyAndFunctionNameClash.kt +++ b/compiler/testData/codegen/box/closures/closureInsideClosure/propertyAndFunctionNameClash.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME package d diff --git a/compiler/testData/codegen/box/delegatedProperty/provideDelegate/evaluationOrderVar.kt b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/evaluationOrderVar.kt index 79e7ad27816..64bf5536c5e 100644 --- a/compiler/testData/codegen/box/delegatedProperty/provideDelegate/evaluationOrderVar.kt +++ b/compiler/testData/codegen/box/delegatedProperty/provideDelegate/evaluationOrderVar.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/delegatedProperty/topLevelVar.kt b/compiler/testData/codegen/box/delegatedProperty/topLevelVar.kt index c8d666e5789..688405e32de 100644 --- a/compiler/testData/codegen/box/delegatedProperty/topLevelVar.kt +++ b/compiler/testData/codegen/box/delegatedProperty/topLevelVar.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty class Delegate { diff --git a/compiler/testData/codegen/box/extensionProperties/inClassLongTypeInReceiver.kt b/compiler/testData/codegen/box/extensionProperties/inClassLongTypeInReceiver.kt index 4bd317d1ab7..f4a3c12530b 100644 --- a/compiler/testData/codegen/box/extensionProperties/inClassLongTypeInReceiver.kt +++ b/compiler/testData/codegen/box/extensionProperties/inClassLongTypeInReceiver.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class Test { var doubleStorage = "fail" var longStorage = "fail" diff --git a/compiler/testData/codegen/box/extensionProperties/inClassWithPrivateSetter.kt b/compiler/testData/codegen/box/extensionProperties/inClassWithPrivateSetter.kt index b3afead5763..de02691a5ac 100644 --- a/compiler/testData/codegen/box/extensionProperties/inClassWithPrivateSetter.kt +++ b/compiler/testData/codegen/box/extensionProperties/inClassWithPrivateSetter.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class Test { var storage = "Fail" diff --git a/compiler/testData/codegen/box/extensionProperties/inClassWithSetter.kt b/compiler/testData/codegen/box/extensionProperties/inClassWithSetter.kt index 4b5f1314706..c562b29e92e 100644 --- a/compiler/testData/codegen/box/extensionProperties/inClassWithSetter.kt +++ b/compiler/testData/codegen/box/extensionProperties/inClassWithSetter.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class Test { var storage = "Fail" diff --git a/compiler/testData/codegen/box/extensionProperties/topLevelLongTypeInReceiver.kt b/compiler/testData/codegen/box/extensionProperties/topLevelLongTypeInReceiver.kt index 47341b8f47a..b00288453a2 100644 --- a/compiler/testData/codegen/box/extensionProperties/topLevelLongTypeInReceiver.kt +++ b/compiler/testData/codegen/box/extensionProperties/topLevelLongTypeInReceiver.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR var fooStorage = "Fail" var barStorage = "Fail" diff --git a/compiler/testData/codegen/box/fakeOverride/propertySetter.kt b/compiler/testData/codegen/box/fakeOverride/propertySetter.kt index 44f9d2c3518..c2f623ba448 100644 --- a/compiler/testData/codegen/box/fakeOverride/propertySetter.kt +++ b/compiler/testData/codegen/box/fakeOverride/propertySetter.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR interface T { var result: String } diff --git a/compiler/testData/codegen/box/inference/coercionToUnitWithLastLambdaExpression.kt b/compiler/testData/codegen/box/inference/coercionToUnitWithLastLambdaExpression.kt index b80fd3ffe35..11590ac5d57 100644 --- a/compiler/testData/codegen/box/inference/coercionToUnitWithLastLambdaExpression.kt +++ b/compiler/testData/codegen/box/inference/coercionToUnitWithLastLambdaExpression.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun myRun(action: () -> T): T = action() fun foo(): String = "foo" diff --git a/compiler/testData/codegen/box/intrinsics/prefixIncDec.kt b/compiler/testData/codegen/box/intrinsics/prefixIncDec.kt index 9b2ae221c5f..00321feb2f9 100644 --- a/compiler/testData/codegen/box/intrinsics/prefixIncDec.kt +++ b/compiler/testData/codegen/box/intrinsics/prefixIncDec.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR public var inc: Int = 0 public var propInc: Int = 0 diff --git a/compiler/testData/codegen/box/multifileClasses/callsToMultifileClassFromOtherPackage.kt b/compiler/testData/codegen/box/multifileClasses/callsToMultifileClassFromOtherPackage.kt index 88a46138834..0dec11f9a46 100644 --- a/compiler/testData/codegen/box/multifileClasses/callsToMultifileClassFromOtherPackage.kt +++ b/compiler/testData/codegen/box/multifileClasses/callsToMultifileClassFromOtherPackage.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_RUNTIME // FILE: 1.kt diff --git a/compiler/testData/codegen/box/operatorConventions/kt4152.kt b/compiler/testData/codegen/box/operatorConventions/kt4152.kt index c81f0890a82..7e494f7f032 100644 --- a/compiler/testData/codegen/box/operatorConventions/kt4152.kt +++ b/compiler/testData/codegen/box/operatorConventions/kt4152.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR public var inc: Int = 0; public var propInc: Int = 0 diff --git a/compiler/testData/codegen/box/properties/kt3551.kt b/compiler/testData/codegen/box/properties/kt3551.kt index c4e5e88af14..ba6696e1417 100644 --- a/compiler/testData/codegen/box/properties/kt3551.kt +++ b/compiler/testData/codegen/box/properties/kt3551.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class Identifier() { private var myNullable : Boolean = false set(l : Boolean) { diff --git a/compiler/testData/codegen/box/properties/lateinit/accessor.kt b/compiler/testData/codegen/box/properties/lateinit/accessor.kt index bce7e9a06cb..441bc5ec592 100644 --- a/compiler/testData/codegen/box/properties/lateinit/accessor.kt +++ b/compiler/testData/codegen/box/properties/lateinit/accessor.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR public class A { fun setMyStr() { diff --git a/compiler/testData/codegen/box/reflection/call/cannotCallEnumConstructor.kt b/compiler/testData/codegen/box/reflection/call/cannotCallEnumConstructor.kt index ed72cf0f83c..042e7c5cbac 100644 --- a/compiler/testData/codegen/box/reflection/call/cannotCallEnumConstructor.kt +++ b/compiler/testData/codegen/box/reflection/call/cannotCallEnumConstructor.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/enclosing/lambdaInPropertySetter.kt b/compiler/testData/codegen/box/reflection/enclosing/lambdaInPropertySetter.kt index ac9f7b1fe2d..575de45e021 100644 --- a/compiler/testData/codegen/box/reflection/enclosing/lambdaInPropertySetter.kt +++ b/compiler/testData/codegen/box/reflection/enclosing/lambdaInPropertySetter.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/statics/incInClassObject.kt b/compiler/testData/codegen/box/statics/incInClassObject.kt index 1396ea8258d..f4cfe90e680 100644 --- a/compiler/testData/codegen/box/statics/incInClassObject.kt +++ b/compiler/testData/codegen/box/statics/incInClassObject.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class A { companion object { private var r: Int = 1; diff --git a/compiler/testData/codegen/box/statics/incInObject.kt b/compiler/testData/codegen/box/statics/incInObject.kt index 0b79f6cb408..c1f48692d36 100644 --- a/compiler/testData/codegen/box/statics/incInObject.kt +++ b/compiler/testData/codegen/box/statics/incInObject.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR object A { private var r: Int = 1; diff --git a/compiler/testData/codegen/box/typeMapping/kt3976.kt b/compiler/testData/codegen/box/typeMapping/kt3976.kt index 8f9e7415ba4..47110878e72 100644 --- a/compiler/testData/codegen/box/typeMapping/kt3976.kt +++ b/compiler/testData/codegen/box/typeMapping/kt3976.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR import kotlin.reflect.KProperty // java.lang.ClassNotFoundException: kotlin.Nothing diff --git a/compiler/testData/ir/irText/classes/classMembers.fir.txt b/compiler/testData/ir/irText/classes/classMembers.fir.txt deleted file mode 100644 index df7bbddadda..00000000000 --- a/compiler/testData/ir/irText/classes/classMembers.fir.txt +++ /dev/null @@ -1,178 +0,0 @@ -FILE fqName: fileName:/classMembers.kt - CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.Int, z:kotlin.Int) returnType:.C [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:y index:1 type:kotlin.Int - VALUE_PARAMETER name:z index:2 type:kotlin.Int - EXPRESSION_BODY - CONST Int type=kotlin.Int value=1 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' - 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 .C.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int - correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - PROPERTY name:z visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Int visibility:private - EXPRESSION_BODY - GET_VAR 'z: kotlin.Int declared in .C.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int - correspondingProperty: PROPERTY name:z visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Int visibility:private' type=kotlin.Int origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C, :kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:z visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.C - VALUE_PARAMETER name: index:0 type:kotlin.Int - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null - CONSTRUCTOR visibility:public <> () returnType:.C - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int, y: kotlin.Int, z: kotlin.Int) [primary] declared in .C' - x: CONST Int type=kotlin.Int value=0 - y: CONST Int type=kotlin.Int value=0 - z: CONST Int type=kotlin.Int value=0 - PROPERTY name:property visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:property type:kotlin.Int visibility:private [final] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=0 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int - correspondingProperty: PROPERTY name:property visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:property type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - PROPERTY name:propertyWithGet visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int - correspondingProperty: PROPERTY name:propertyWithGet visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' - CONST Int type=kotlin.Int value=42 - PROPERTY name:propertyWithGetAndSet visibility:public modality:FINAL [var] - FUN name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int - correspondingProperty: PROPERTY name:propertyWithGetAndSet visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' - CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .C declared in .C.' type=.C origin=null - FUN name: visibility:public modality:FINAL <> ($this:.C, value:kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:propertyWithGetAndSet visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.C - VALUE_PARAMETER name:value index:0 type:kotlin.Int - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - value: GET_VAR 'value: kotlin.Int declared in .C.' type=kotlin.Int origin=null - FUN name:function visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null - message: CONST String type=kotlin.String value="1" - FUN name:memberExtensionFunction visibility:public modality:FINAL <> ($this:.C, $receiver:kotlin.Int) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.C - $receiver: VALUE_PARAMETER name: type:kotlin.Int - BLOCK_BODY - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null - message: CONST String type=kotlin.String value="2" - CLASS CLASS name:NestedClass modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C.NestedClass - CONSTRUCTOR visibility:public <> () returnType:.C.NestedClass [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:NestedClass modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:function visibility:public modality:FINAL <> ($this:.C.NestedClass) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.C.NestedClass - BLOCK_BODY - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null - message: CONST String type=kotlin.String value="3" - FUN name:memberExtensionFunction visibility:public modality:FINAL <> ($this:.C.NestedClass, $receiver:kotlin.Int) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.C.NestedClass - $receiver: VALUE_PARAMETER name: type:kotlin.Int - BLOCK_BODY - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null - message: CONST String type=kotlin.String value="4" - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:NestedInterface modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C.NestedInterface - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.C.NestedInterface) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.C.NestedInterface - FUN name:bar visibility:public modality:OPEN <> ($this:.C.NestedInterface) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.C.NestedInterface - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun bar (): kotlin.Unit declared in .C.NestedInterface' - CALL 'public abstract fun foo (): kotlin.Unit declared in .C.NestedInterface' type=kotlin.Unit origin=null - $this: GET_VAR ': .C.NestedInterface declared in .C.NestedInterface.bar' type=.C.NestedInterface origin=null - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C.Companion - CONSTRUCTOR visibility:private <> () returnType:.C.Companion [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/classMembers.kt b/compiler/testData/ir/irText/classes/classMembers.kt index bc3d7d96adf..12aa54fc3eb 100644 --- a/compiler/testData/ir/irText/classes/classMembers.kt +++ b/compiler/testData/ir/irText/classes/classMembers.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // WITH_RUNTIME class C(x: Int, val y: Int, var z: Int = 1) { diff --git a/compiler/testData/ir/irText/classes/enumWithMultipleCtors.fir.txt b/compiler/testData/ir/irText/classes/enumWithMultipleCtors.fir.txt index c3359a23d7d..1146b5fade8 100644 --- a/compiler/testData/ir/irText/classes/enumWithMultipleCtors.fir.txt +++ b/compiler/testData/ir/irText/classes/enumWithMultipleCtors.fir.txt @@ -91,18 +91,18 @@ FILE fqName: fileName:/enumWithMultipleCtors.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop1 type:kotlin.String visibility:private [final]' type=kotlin.Unit origin=null receiver: GET_VAR ': .A declared in .A' type=.A origin=null value: CONST String type=kotlin.String value="default" - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop3 type:kotlin.String visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .A declared in .A' type=.A origin=null - value: CONST String type=kotlin.String value="empty" + CALL 'public final fun (: kotlin.String): kotlin.Unit declared in .A' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .A declared in .A' type=.A origin=null + : CONST String type=kotlin.String value="empty" ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' : .A INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Enum<.A>]' CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.A VALUE_PARAMETER name:x index:0 type:kotlin.Int BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:prop3 type:kotlin.String visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .A declared in .A' type=.A origin=null - value: CONST String type=kotlin.String value="int" + CALL 'public final fun (: kotlin.String): kotlin.Unit declared in .A' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .A declared in .A' type=.A origin=null + : CONST String type=kotlin.String value="int" ENUM_CONSTRUCTOR_CALL 'private constructor (arg: kotlin.String) declared in .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 .A.' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/classes/initVar.fir.txt b/compiler/testData/ir/irText/classes/initVar.fir.txt index 2e33ef48c59..8b86c54456d 100644 --- a/compiler/testData/ir/irText/classes/initVar.fir.txt +++ b/compiler/testData/ir/irText/classes/initVar.fir.txt @@ -101,9 +101,9 @@ FILE fqName: fileName:/initVar.kt value: GET_VAR ': kotlin.Int declared in .TestInitVarInInitBlock.' type=kotlin.Int origin=null ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .TestInitVarInInitBlock declared in .TestInitVarInInitBlock' type=.TestInitVarInInitBlock origin=null - value: CONST Int type=kotlin.Int value=0 + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .TestInitVarInInitBlock' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .TestInitVarInInitBlock declared in .TestInitVarInInitBlock' type=.TestInitVarInInitBlock origin=null + : CONST Int type=kotlin.Int value=0 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any @@ -174,8 +174,8 @@ FILE fqName: fileName:/initVar.kt value: GET_VAR 'value: kotlin.Int declared in .TestInitVarWithCustomSetterWithExplicitCtor.' type=kotlin.Int origin=null ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .TestInitVarWithCustomSetterWithExplicitCtor declared in .TestInitVarWithCustomSetterWithExplicitCtor' type=.TestInitVarWithCustomSetterWithExplicitCtor origin=null + CALL 'public final fun (value: kotlin.Int): kotlin.Unit declared in .TestInitVarWithCustomSetterWithExplicitCtor' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .TestInitVarWithCustomSetterWithExplicitCtor declared in .TestInitVarWithCustomSetterWithExplicitCtor' type=.TestInitVarWithCustomSetterWithExplicitCtor origin=null value: CONST Int type=kotlin.Int value=0 CONSTRUCTOR visibility:public <> () returnType:.TestInitVarWithCustomSetterWithExplicitCtor BLOCK_BODY @@ -214,8 +214,8 @@ FILE fqName: fileName:/initVar.kt value: GET_VAR 'value: kotlin.Int declared in .TestInitVarWithCustomSetterInCtor.' type=kotlin.Int origin=null CONSTRUCTOR visibility:public <> () returnType:.TestInitVarWithCustomSetterInCtor BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .TestInitVarWithCustomSetterInCtor declared in .TestInitVarWithCustomSetterInCtor' type=.TestInitVarWithCustomSetterInCtor origin=null + CALL 'public final fun (value: kotlin.Int): kotlin.Unit declared in .TestInitVarWithCustomSetterInCtor' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .TestInitVarWithCustomSetterInCtor declared in .TestInitVarWithCustomSetterInCtor' type=.TestInitVarWithCustomSetterInCtor origin=null value: CONST Int type=kotlin.Int value=42 DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitVarWithCustomSetterInCtor modality:FINAL visibility:public superTypes:[kotlin.Any]' diff --git a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.txt index 32639926c3f..85ada12565b 100644 --- a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.txt @@ -67,9 +67,9 @@ FILE fqName: fileName:/delegatedPropertyAccessorsWithAnnotations.kt VALUE_PARAMETER name:kProp index:1 type:kotlin.Any? VALUE_PARAMETER name:newValue index:2 type:kotlin.Int BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .Cell declared in .Cell.setValue' type=.Cell origin=null - value: GET_VAR 'newValue: kotlin.Int declared in .Cell.setValue' type=kotlin.Int origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Cell' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .Cell declared in .Cell.setValue' type=.Cell origin=null + : GET_VAR 'newValue: kotlin.Int declared in .Cell.setValue' type=kotlin.Int origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/assignments.fir.txt b/compiler/testData/ir/irText/expressions/assignments.fir.txt index dea4e173e1f..3d72ce8ddcc 100644 --- a/compiler/testData/ir/irText/expressions/assignments.fir.txt +++ b/compiler/testData/ir/irText/expressions/assignments.fir.txt @@ -51,6 +51,6 @@ FILE fqName: fileName:/assignments.kt FUN name:test2 visibility:public modality:FINAL <> (r:.Ref) returnType:kotlin.Unit VALUE_PARAMETER name:r index:0 type:.Ref BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR 'r: .Ref declared in .test2' type=.Ref origin=null - value: CONST Int type=kotlin.Int value=0 + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Ref' type=kotlin.Unit origin=EQ + $this: GET_VAR 'r: .Ref declared in .test2' type=.Ref origin=null + : CONST Int type=kotlin.Int value=0 diff --git a/compiler/testData/ir/irText/expressions/augmentedAssignment1.fir.txt b/compiler/testData/ir/irText/expressions/augmentedAssignment1.fir.txt index 96c60969c2c..751e10f9a3a 100644 --- a/compiler/testData/ir/irText/expressions/augmentedAssignment1.fir.txt +++ b/compiler/testData/ir/irText/expressions/augmentedAssignment1.fir.txt @@ -40,23 +40,23 @@ FILE fqName: fileName:/augmentedAssignment1.kt other: CONST Int type=kotlin.Int value=5 FUN name:testProperty visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null - value: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY other: CONST Int type=kotlin.Int value=1 - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null - value: CALL 'public final fun minus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : CALL 'public final fun minus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY other: CONST Int type=kotlin.Int value=2 - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null - value: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY other: CONST Int type=kotlin.Int value=3 - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null - value: CALL 'public final fun div (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : CALL 'public final fun div (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY other: CONST Int type=kotlin.Int value=4 - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null - value: CALL 'public final fun rem (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : CALL 'public final fun rem (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY other: CONST Int type=kotlin.Int value=5 diff --git a/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.fir.txt b/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.fir.txt index 0233ee89c2b..a3545de13d8 100644 --- a/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.fir.txt +++ b/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.fir.txt @@ -145,25 +145,25 @@ FILE fqName: fileName:/complexAugmentedAssignment.kt VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val] CALL 'public final fun (): kotlin.Int declared in .X1' type=kotlin.Int origin=GET_PROPERTY $this: GET_OBJECT 'CLASS OBJECT name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.X1 - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x1 type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_OBJECT 'CLASS OBJECT name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.X1 - value: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .X1' type=kotlin.Unit origin=EQ + $this: GET_OBJECT 'CLASS OBJECT name:X1 modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.X1 + : CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'val tmp_3: kotlin.Int [val] declared in .test2' type=kotlin.Int origin=null GET_VAR 'val tmp_3: kotlin.Int [val] declared in .test2' type=kotlin.Int origin=null VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Int [val] CALL 'public final fun (): kotlin.Int declared in .X1.X2' type=kotlin.Int origin=GET_PROPERTY $this: GET_OBJECT 'CLASS OBJECT name:X2 modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.X1.X2 - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x2 type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_OBJECT 'CLASS OBJECT name:X2 modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.X1.X2 - value: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .X1.X2' type=kotlin.Unit origin=EQ + $this: GET_OBJECT 'CLASS OBJECT name:X2 modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.X1.X2 + : CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'val tmp_4: kotlin.Int [val] declared in .test2' type=kotlin.Int origin=null GET_VAR 'val tmp_4: kotlin.Int [val] declared in .test2' type=kotlin.Int origin=null VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val] CALL 'public final fun (): kotlin.Int declared in .X1.X2.X3' type=kotlin.Int origin=GET_PROPERTY $this: GET_OBJECT 'CLASS OBJECT name:X3 modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.X1.X2.X3 - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x3 type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_OBJECT 'CLASS OBJECT name:X3 modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.X1.X2.X3 - value: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .X1.X2.X3' type=kotlin.Unit origin=EQ + $this: GET_OBJECT 'CLASS OBJECT name:X3 modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.X1.X2.X3 + : CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'val tmp_5: kotlin.Int [val] declared in .test2' type=kotlin.Int origin=null GET_VAR 'val tmp_5: kotlin.Int [val] declared in .test2' type=kotlin.Int origin=null CLASS CLASS name:B modality:FINAL visibility:public superTypes:[kotlin.Any] @@ -218,8 +218,8 @@ FILE fqName: fileName:/complexAugmentedAssignment.kt $receiver: VALUE_PARAMETER name: type:.B VALUE_PARAMETER name:b index:0 type:.B BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - value: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .B' type=kotlin.Unit origin=EQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun (): kotlin.Int declared in .B' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .B declared in .Host.plusAssign' type=.B origin=null other: CALL 'public final fun (): kotlin.Int declared in .B' type=kotlin.Int origin=GET_PROPERTY diff --git a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt index fbcfa46ee98..f5d47a1d9c8 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt +++ b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt @@ -40,9 +40,9 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt FUN name:bar visibility:public modality:FINAL <> ($this:.MyEnum.Z) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.MyEnum.Z BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z' type=.MyEnum.Z origin=null - value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z' type=.MyEnum.Z origin=null + : CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=null $this: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z' type=.MyEnum.Z origin=null PROPERTY name:aLambda visibility:public modality:FINAL [val] @@ -51,9 +51,9 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt FUN_EXPR type=kotlin.Function0 origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z' type=.MyEnum.Z origin=null - value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z' type=.MyEnum.Z origin=null + : CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=null $this: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z' type=.MyEnum.Z origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.MyEnum.Z) returnType:kotlin.Function0 @@ -75,17 +75,17 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.Any]' ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z' type=.MyEnum.Z origin=null - value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z' type=.MyEnum.Z origin=null + : CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=null $this: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z' type=.MyEnum.Z origin=null FUN name:test visibility:public modality:FINAL <> ($this:.MyEnum.Z.anObject.) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.MyEnum.Z.anObject. BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z' type=.MyEnum.Z origin=null - value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z' type=.MyEnum.Z origin=null + : CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=null $this: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z' type=.MyEnum.Z origin=null CONSTRUCTOR_CALL 'private constructor () [primary] declared in .MyEnum.Z.anObject.' type=.MyEnum.Z.anObject. origin=OBJECT_LITERAL diff --git a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.txt b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.txt index ab87e13d481..bc9283259c8 100644 --- a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.txt +++ b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.txt @@ -84,9 +84,9 @@ FILE fqName: fileName:/forWithImplicitReceivers.kt VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int [val] CALL 'public final fun (): kotlin.Int declared in .IntCell' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .IntCell declared in .IReceiver.next' type=.IntCell origin=null - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .IntCell declared in .IReceiver.next' type=.IntCell origin=null - value: CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .IntCell' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .IntCell declared in .IReceiver.next' type=.IntCell origin=null + : CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'val tmp_0: kotlin.Int [val] declared in .IReceiver.next' type=kotlin.Int origin=null GET_VAR 'val tmp_0: kotlin.Int [val] declared in .IReceiver.next' type=kotlin.Int origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] diff --git a/compiler/testData/ir/irText/expressions/genericPropertyRef.fir.txt b/compiler/testData/ir/irText/expressions/genericPropertyRef.fir.txt index 4690254cb05..8bd43bec116 100644 --- a/compiler/testData/ir/irText/expressions/genericPropertyRef.fir.txt +++ b/compiler/testData/ir/irText/expressions/genericPropertyRef.fir.txt @@ -176,10 +176,10 @@ FILE fqName: fileName:/genericPropertyRef.kt $receiver: VALUE_PARAMETER name: type:T of . VALUE_PARAMETER name:value index:0 type:T of . BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:recivier type:kotlin.Any? visibility:private [static]' type=kotlin.Unit origin=null - value: ERROR_CALL 'Unresolved reference: this@R|/bar|' type=T of . - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.Any? visibility:private [static]' type=kotlin.Unit origin=null - value: GET_VAR 'value: T of . declared in .' type=T of . origin=null + CALL 'public final fun (: kotlin.Any?): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : ERROR_CALL 'Unresolved reference: this@R|/bar|' type=T of . + CALL 'public final fun (: kotlin.Any?): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : GET_VAR 'value: T of . declared in .' type=T of . origin=null PROPERTY name:barRef visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:barRef type:kotlin.reflect.KMutableProperty1 visibility:private [final,static] EXPRESSION_BODY diff --git a/compiler/testData/ir/irText/expressions/incrementDecrement.fir.txt b/compiler/testData/ir/irText/expressions/incrementDecrement.fir.txt index ccb07646aab..b855bf823fc 100644 --- a/compiler/testData/ir/irText/expressions/incrementDecrement.fir.txt +++ b/compiler/testData/ir/irText/expressions/incrementDecrement.fir.txt @@ -73,16 +73,16 @@ FILE fqName: fileName:/incrementDecrement.kt BLOCK type=kotlin.Int origin=null VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Int [val] CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null - value: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'val tmp_4: kotlin.Int [val] declared in .testPropPrefix' type=kotlin.Int origin=null CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY VAR name:p2 type:kotlin.Int [val] BLOCK type=kotlin.Int origin=null VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [val] CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null - value: CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'val tmp_5: kotlin.Int [val] declared in .testPropPrefix' type=kotlin.Int origin=null CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY FUN name:testPropPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit @@ -91,16 +91,16 @@ FILE fqName: fileName:/incrementDecrement.kt BLOCK type=kotlin.Int origin=null VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.Int [val] CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null - value: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'val tmp_6: kotlin.Int [val] declared in .testPropPostfix' type=kotlin.Int origin=null GET_VAR 'val tmp_6: kotlin.Int [val] declared in .testPropPostfix' type=kotlin.Int origin=null VAR name:p2 type:kotlin.Int [val] BLOCK type=kotlin.Int origin=null VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.Int [val] CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null - value: CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'val tmp_7: kotlin.Int [val] declared in .testPropPostfix' type=kotlin.Int origin=null CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=GET_PROPERTY FUN name:testArrayPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit diff --git a/compiler/testData/ir/irText/expressions/javaSyntheticPropertyAccess.fir.txt b/compiler/testData/ir/irText/expressions/javaSyntheticPropertyAccess.fir.txt index da59514f8aa..64f79841b02 100644 --- a/compiler/testData/ir/irText/expressions/javaSyntheticPropertyAccess.fir.txt +++ b/compiler/testData/ir/irText/expressions/javaSyntheticPropertyAccess.fir.txt @@ -4,10 +4,19 @@ FILE fqName: fileName:/javaSyntheticPropertyAccess.kt BLOCK_BODY CALL 'public open fun (): kotlin.Int declared in .J' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR 'j: .J declared in .test' type=.J origin=null - ERROR_CALL 'Unresolved reference: R|/J.foo|' type=IrErrorType + CALL 'public open fun (x: kotlin.Int): kotlin.Unit declared in .J' type=kotlin.Unit origin=EQ + $this: GET_VAR 'j: .J declared in .test' type=.J origin=null + x: CONST Int type=kotlin.Int value=1 VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int [val] CALL 'public open fun (): kotlin.Int declared in .J' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR 'j: .J declared in .test' type=.J origin=null - ERROR_CALL 'Unresolved reference: R|/J.foo|' type=IrErrorType + CALL 'public open fun (x: kotlin.Int): kotlin.Unit declared in .J' type=kotlin.Unit origin=EQ + $this: GET_VAR 'j: .J declared in .test' type=.J origin=null + x: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_0: kotlin.Int [val] declared in .test' type=kotlin.Int origin=null GET_VAR 'val tmp_0: kotlin.Int [val] declared in .test' type=kotlin.Int origin=null - ERROR_CALL 'Unresolved reference: R|/J.foo|' type=IrErrorType + CALL 'public open fun (x: kotlin.Int): kotlin.Unit declared in .J' type=kotlin.Unit origin=EQ + x: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public open fun (): kotlin.Int declared in .J' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'j: .J declared in .test' type=.J origin=null + other: CONST Int type=kotlin.Int value=1 diff --git a/compiler/testData/ir/irText/expressions/kt16904.fir.txt b/compiler/testData/ir/irText/expressions/kt16904.fir.txt index fcf75cce4ab..8c53e2af42d 100644 --- a/compiler/testData/ir/irText/expressions/kt16904.fir.txt +++ b/compiler/testData/ir/irText/expressions/kt16904.fir.txt @@ -79,8 +79,8 @@ FILE fqName: fileName:/kt16904.kt $this: CALL 'public final fun (): .B declared in .A' type=.B origin=GET_PROPERTY $this: GET_VAR ': .Test1 declared in .Test1' type=.Test1 origin=null x: CONST Int type=kotlin.Int value=42 - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - value: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .A' type=kotlin.Unit origin=EQ + : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun (): kotlin.Int declared in .A' type=kotlin.Int origin=GET_PROPERTY $this: GET_VAR ': .Test1 declared in .Test1' type=.Test1 origin=null other: CONST Int type=kotlin.Int value=42 diff --git a/compiler/testData/ir/irText/expressions/objectReference.fir.txt b/compiler/testData/ir/irText/expressions/objectReference.fir.txt index c7ed289c97d..601f1a61b3e 100644 --- a/compiler/testData/ir/irText/expressions/objectReference.fir.txt +++ b/compiler/testData/ir/irText/expressions/objectReference.fir.txt @@ -30,14 +30,14 @@ FILE fqName: fileName:/objectReference.kt FUN name:bar visibility:public modality:FINAL <> ($this:.Z) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.Z BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .Z declared in .Z.bar' type=.Z origin=null - value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .Z declared in .Z.bar' type=.Z origin=null + : CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null $this: GET_VAR ': .Z declared in .Z.bar' type=.Z origin=null - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + : CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z CLASS CLASS name:Nested modality:FINAL visibility:public superTypes:[kotlin.Any] @@ -48,27 +48,27 @@ FILE fqName: fileName:/objectReference.kt INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Nested modality:FINAL visibility:public superTypes:[kotlin.Any]' ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + : CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + : CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z FUN name:test visibility:public modality:FINAL <> ($this:.Z.Nested) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.Z.Nested BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + : CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + : CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -90,14 +90,14 @@ FILE fqName: fileName:/objectReference.kt FUN_EXPR type=kotlin.Function0 origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .Z declared in .Z' type=.Z origin=null - value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .Z declared in .Z' type=.Z origin=null + : CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null $this: GET_VAR ': .Z declared in .Z' type=.Z origin=null - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + : CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Z) returnType:kotlin.Function0 @@ -119,27 +119,27 @@ FILE fqName: fileName:/objectReference.kt INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.Any]' ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + : CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + : CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z FUN name:test visibility:public modality:FINAL <> ($this:.Z.anObject.) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.Z.anObject. BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + : CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + : CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z CONSTRUCTOR_CALL 'private constructor () [primary] declared in .Z.anObject.' type=.Z.anObject. origin=OBJECT_LITERAL @@ -166,13 +166,13 @@ FILE fqName: fileName:/objectReference.kt FUN name:test visibility:public modality:FINAL <> ($receiver:.Z) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:.Z BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .Z declared in .test' type=.Z origin=null - value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ + $this: GET_VAR ': .Z declared in .test' type=.Z origin=null + : CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null $this: GET_VAR ': .Z declared in .test' type=.Z origin=null - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - value: CONST Int type=kotlin.Int value=1 + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Z' type=kotlin.Unit origin=EQ + $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z + : CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z diff --git a/compiler/testData/ir/irText/expressions/safeAssignment.fir.txt b/compiler/testData/ir/irText/expressions/safeAssignment.fir.txt index f9c1eaa1dd7..c9cc6b8989a 100644 --- a/compiler/testData/ir/irText/expressions/safeAssignment.fir.txt +++ b/compiler/testData/ir/irText/expressions/safeAssignment.fir.txt @@ -41,6 +41,6 @@ FILE fqName: fileName:/safeAssignment.kt FUN name:test visibility:public modality:FINAL <> (nc:.C?) returnType:kotlin.Unit VALUE_PARAMETER name:nc index:0 type:.C? BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR 'nc: .C? declared in .test' type=.C? origin=null - value: CONST Int type=kotlin.Int value=42 + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=EQ + $this: GET_VAR 'nc: .C? declared in .test' type=.C? origin=null + : CONST Int type=kotlin.Int value=42 diff --git a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.txt b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.txt index 40f8d3fe6db..0d9d574e0b3 100644 --- a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.txt +++ b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.txt @@ -53,7 +53,10 @@ FILE fqName:test fileName:/safeCallWithIncrementDecrement.kt VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int? [val] CALL 'public final fun (): kotlin.Int declared in test' type=kotlin.Int? origin=GET_PROPERTY $receiver: GET_VAR 'nc: test.C? declared in test.testProperty' type=test.C? origin=null - ERROR_CALL 'Unresolved reference: R|test/p|' type=IrErrorType + CALL 'public final fun (value: kotlin.Int): kotlin.Unit declared in test' type=kotlin.Unit origin=EQ + $receiver: GET_VAR 'nc: test.C? declared in test.testProperty' type=test.C? origin=null + value: CALL 'public final fun inc (): kotlin.Int? [operator] declared in test' type=kotlin.Int? origin=null + $receiver: GET_VAR 'val tmp_0: kotlin.Int? [val] declared in test.testProperty' type=kotlin.Int? origin=null GET_VAR 'val tmp_0: kotlin.Int? [val] declared in test.testProperty' type=kotlin.Int? origin=null FUN name:testArrayAccess visibility:public modality:FINAL <> (nc:test.C?) returnType:kotlin.Unit VALUE_PARAMETER name:nc index:0 type:test.C? diff --git a/compiler/testData/ir/irText/expressions/safeCalls.fir.txt b/compiler/testData/ir/irText/expressions/safeCalls.fir.txt index c988276a94c..63e916b0e9c 100644 --- a/compiler/testData/ir/irText/expressions/safeCalls.fir.txt +++ b/compiler/testData/ir/irText/expressions/safeCalls.fir.txt @@ -83,9 +83,9 @@ FILE fqName: fileName:/safeCalls.kt FUN name:test4 visibility:public modality:FINAL <> (x:.Ref?) returnType:kotlin.Unit VALUE_PARAMETER name:x index:0 type:.Ref? BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR 'x: .Ref? declared in .test4' type=.Ref? origin=null - value: CONST Int type=kotlin.Int value=0 + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Ref' type=kotlin.Unit origin=EQ + $this: GET_VAR 'x: .Ref? declared in .test4' type=.Ref? origin=null + : CONST Int type=kotlin.Int value=0 FUN name:test5 visibility:public modality:FINAL <> ($receiver:.IHost, s:kotlin.String?) returnType:kotlin.Int? $receiver: VALUE_PARAMETER name: type:.IHost VALUE_PARAMETER name:s index:0 type:kotlin.String? diff --git a/compiler/testData/ir/irText/expressions/useImportedMember.fir.txt b/compiler/testData/ir/irText/expressions/useImportedMember.fir.txt index 2ebfda66fa0..e5a444275f4 100644 --- a/compiler/testData/ir/irText/expressions/useImportedMember.fir.txt +++ b/compiler/testData/ir/irText/expressions/useImportedMember.fir.txt @@ -194,9 +194,9 @@ FILE fqName: fileName:/useImportedMember.kt arg1: CONST Int type=kotlin.Int value=4 then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' CONST String type=kotlin.String value="4" - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_OBJECT 'CLASS OBJECT name:C modality:FINAL visibility:public superTypes:[.BaseClass; .I]' type=.C - value: CONST Int type=kotlin.Int value=5 + CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=EQ + $this: GET_OBJECT 'CLASS OBJECT name:C modality:FINAL visibility:public superTypes:[.BaseClass; .I]' type=.C + : CONST Int type=kotlin.Int value=5 WHEN type=kotlin.Unit origin=IF BRANCH if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ diff --git a/compiler/testData/ir/irText/regressions/integerCoercionToT.fir.txt b/compiler/testData/ir/irText/regressions/integerCoercionToT.fir.txt index 3a8ae2ef86e..f9828625ce4 100644 --- a/compiler/testData/ir/irText/regressions/integerCoercionToT.fir.txt +++ b/compiler/testData/ir/irText/regressions/integerCoercionToT.fir.txt @@ -89,4 +89,8 @@ FILE fqName: fileName:/integerCoercionToT.kt VALUE_PARAMETER name:value index:0 type:.IdType VALUE_PARAMETER name:cv index:1 type:.CInt32VarX BLOCK_BODY - ERROR_CALL 'Unresolved reference: R|/value|' type=IrErrorType + CALL 'public final fun (value: T_INT of .): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ + : + $receiver: GET_VAR 'cv: .CInt32VarX declared in .foo' type=.CInt32VarX origin=null + value: CALL 'public final fun (): kotlin.Int declared in .IdType' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'value: .IdType declared in .foo' type=.IdType origin=null diff --git a/compiler/testData/ir/irText/types/genericPropertyReferenceType.fir.txt b/compiler/testData/ir/irText/types/genericPropertyReferenceType.fir.txt index 28a473b5cd0..59f00c0b3e3 100644 --- a/compiler/testData/ir/irText/types/genericPropertyReferenceType.fir.txt +++ b/compiler/testData/ir/irText/types/genericPropertyReferenceType.fir.txt @@ -54,9 +54,9 @@ FILE fqName: fileName:/genericPropertyReferenceType.kt $receiver: VALUE_PARAMETER name: type:.C.> VALUE_PARAMETER name:v index:0 type:T of . BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .C visibility:private' type=kotlin.Unit origin=null - receiver: ERROR_CALL 'Unresolved reference: this@R|/y|' type=.C.> - value: GET_VAR 'v: T of . declared in .' type=T of . origin=null + CALL 'public final fun (: T of .C): kotlin.Unit declared in .C' type=kotlin.Unit origin=EQ + $this: ERROR_CALL 'Unresolved reference: this@R|/y|' type=.C.> + : GET_VAR 'v: T of . declared in .' type=T of . origin=null FUN name:use visibility:public modality:FINAL <> (p:kotlin.reflect.KMutableProperty) returnType:kotlin.Unit VALUE_PARAMETER name:p index:0 type:kotlin.reflect.KMutableProperty BLOCK_BODY diff --git a/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.fir.txt b/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.fir.txt index 3cf39d6666d..ea74d6381f0 100644 --- a/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.fir.txt +++ b/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.fir.txt @@ -20,7 +20,11 @@ FILE fqName: fileName:/smartCastOnReceiverOfGenericType.kt GET_VAR 'a: kotlin.Any declared in .testProperty' type=kotlin.Any origin=null TYPE_OP type=kotlin.String origin=CAST typeOperand=kotlin.String GET_VAR 'b: kotlin.Any declared in .testProperty' type=kotlin.Any origin=null - ERROR_CALL 'Unresolved reference: R|FakeOverride|' type=IrErrorType + CALL 'public final fun (: T of .Cell): kotlin.Unit declared in .Cell' type=kotlin.Unit origin=EQ + $this: TYPE_OP type=.Cell origin=IMPLICIT_CAST typeOperand=.Cell + GET_VAR 'a: kotlin.Any declared in .testProperty' type=kotlin.Any origin=null + : TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'b: kotlin.Any declared in .testProperty' type=kotlin.Any origin=null FUN name:testInnerClass visibility:public modality:FINAL <> (a:kotlin.Any, b:kotlin.Any, c:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any VALUE_PARAMETER name:b index:1 type:kotlin.Any