diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/DataClassMembersGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/DataClassMembersGenerator.kt index 0beb54978af..6de0b518f58 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/DataClassMembersGenerator.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/DataClassMembersGenerator.kt @@ -158,7 +158,7 @@ class DataClassMembersGenerator(val components: Fir2IrComponents) : Fir2IrCompon fun generateDispatchReceiverParameter(irFunction: IrFunction) = irFunction.declareThisReceiverParameter( irClass.defaultType, - origin, + IrDeclarationOrigin.DEFINED, UNDEFINED_OFFSET, UNDEFINED_OFFSET ) @@ -221,7 +221,8 @@ class DataClassMembersGenerator(val components: Fir2IrComponents) : Fir2IrCompon EQUALS, components.irBuiltIns.booleanType, isExpect = klass.isExpect, - otherParameterNeeded = true + otherParameterNeeded = true, + isOperator = true ) irDataClassMembersGenerator.generateEqualsMethod(equalsFunction, properties) irClass.declarations.add(equalsFunction) @@ -271,7 +272,8 @@ class DataClassMembersGenerator(val components: Fir2IrComponents) : Fir2IrCompon name: Name, returnType: IrType, isExpect: Boolean, - otherParameterNeeded: Boolean = false + otherParameterNeeded: Boolean = false, + isOperator: Boolean = false, ): IrFunction { val functionSymbol = FirNamedFunctionSymbol(CallableId(lookupTag.classId, name)) val firFunction = buildSimpleFunction { @@ -309,7 +311,7 @@ class DataClassMembersGenerator(val components: Fir2IrComponents) : Fir2IrCompon return components.declarationStorage.declareIrSimpleFunction(signature) { symbol -> components.irFactory.createFunction( UNDEFINED_OFFSET, UNDEFINED_OFFSET, origin, symbol, name, DescriptorVisibilities.PUBLIC, Modality.OPEN, returnType, - isInline = false, isExternal = false, isTailrec = false, isSuspend = false, isOperator = false, + isInline = false, isExternal = false, isTailrec = false, isSuspend = false, isOperator = isOperator, isInfix = false, isExpect = false, isFakeOverride = false, ).apply { if (otherParameterNeeded) { @@ -336,7 +338,7 @@ class DataClassMembersGenerator(val components: Fir2IrComponents) : Fir2IrCompon private fun createSyntheticIrParameter(irFunction: IrFunction, name: Name, type: IrType, index: Int = 0): IrValueParameter = components.irFactory.createValueParameter( - UNDEFINED_OFFSET, UNDEFINED_OFFSET, origin, IrValueParameterSymbolImpl(), name, index, type, null, + UNDEFINED_OFFSET, UNDEFINED_OFFSET, IrDeclarationOrigin.DEFINED, IrValueParameterSymbolImpl(), name, index, type, null, isCrossinline = false, isNoinline = false, isHidden = false, isAssignable = false ).apply { parent = irFunction diff --git a/compiler/testData/codegen/boxModernJdk/testsWithJava17/records/recordWithCompanion.fir.ir.txt b/compiler/testData/codegen/boxModernJdk/testsWithJava17/records/recordWithCompanion.fir.ir.txt index 2e6e650eac0..5d8316d907e 100644 --- a/compiler/testData/codegen/boxModernJdk/testsWithJava17/records/recordWithCompanion.fir.ir.txt +++ b/compiler/testData/codegen/boxModernJdk/testsWithJava17/records/recordWithCompanion.fir.ir.txt @@ -54,24 +54,24 @@ FILE fqName: fileName:/recordWithCompanion.kt RETURN type=kotlin.Nothing from='public final fun copy (id: kotlin.String): .Tag declared in .Tag' CONSTRUCTOR_CALL 'public constructor (id: kotlin.String) [primary] declared in .Tag' type=.Tag origin=null id: GET_VAR 'id: kotlin.String declared in .Tag.copy' type=kotlin.String origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Tag, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Tag, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Tag - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.Tag + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .Tag declared in .Tag.equals' type=.Tag origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .Tag.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Tag' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Tag' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.Tag GET_VAR 'other: kotlin.Any? declared in .Tag.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Tag' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Tag' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.Tag [val] TYPE_OP type=.Tag origin=CAST typeOperand=.Tag @@ -84,14 +84,14 @@ FILE fqName: fileName:/recordWithCompanion.kt receiver: GET_VAR ': .Tag declared in .Tag.equals' type=.Tag origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:id type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR 'val tmp_0: .Tag [val] declared in .Tag.equals' type=.Tag origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Tag' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Tag' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Tag' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Tag' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Tag) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Tag + $this: VALUE_PARAMETER name: type:.Tag BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Tag' CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.String' type=kotlin.Int origin=null @@ -100,7 +100,7 @@ FILE fqName: fileName:/recordWithCompanion.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Tag) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Tag + $this: VALUE_PARAMETER name: type:.Tag BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Tag' STRING_CONCATENATION type=kotlin.String diff --git a/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.fir.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.fir.ir.txt index 4677adecaba..348434a3376 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.fir.ir.txt @@ -217,24 +217,24 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt longArray: GET_VAR 'longArray: kotlin.LongArray declared in .Test1.copy' type=kotlin.LongArray origin=null floatArray: GET_VAR 'floatArray: kotlin.FloatArray declared in .Test1.copy' type=kotlin.FloatArray origin=null doubleArray: GET_VAR 'doubleArray: kotlin.DoubleArray declared in .Test1.copy' type=kotlin.DoubleArray origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test1, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test1, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test1 - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.Test1 + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .Test1 declared in .Test1.equals' type=.Test1 origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .Test1.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test1' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test1' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.Test1 GET_VAR 'other: kotlin.Any? declared in .Test1.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test1' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test1' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.Test1 [val] TYPE_OP type=.Test1 origin=CAST typeOperand=.Test1 @@ -247,7 +247,7 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt receiver: GET_VAR ': .Test1 declared in .Test1.equals' type=.Test1 origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:stringArray type:kotlin.Array visibility:private [final]' type=kotlin.Array origin=null receiver: GET_VAR 'val tmp_0: .Test1 [val] declared in .Test1.equals' type=.Test1 origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test1' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test1' CONST Boolean type=kotlin.Boolean value=false WHEN type=kotlin.Unit origin=null BRANCH @@ -257,7 +257,7 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt receiver: GET_VAR ': .Test1 declared in .Test1.equals' type=.Test1 origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:charArray type:kotlin.CharArray visibility:private [final]' type=kotlin.CharArray origin=null receiver: GET_VAR 'val tmp_0: .Test1 [val] declared in .Test1.equals' type=.Test1 origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test1' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test1' CONST Boolean type=kotlin.Boolean value=false WHEN type=kotlin.Unit origin=null BRANCH @@ -267,7 +267,7 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt receiver: GET_VAR ': .Test1 declared in .Test1.equals' type=.Test1 origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:booleanArray type:kotlin.BooleanArray visibility:private [final]' type=kotlin.BooleanArray origin=null receiver: GET_VAR 'val tmp_0: .Test1 [val] declared in .Test1.equals' type=.Test1 origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test1' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test1' CONST Boolean type=kotlin.Boolean value=false WHEN type=kotlin.Unit origin=null BRANCH @@ -277,7 +277,7 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt receiver: GET_VAR ': .Test1 declared in .Test1.equals' type=.Test1 origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:byteArray type:kotlin.ByteArray visibility:private [final]' type=kotlin.ByteArray origin=null receiver: GET_VAR 'val tmp_0: .Test1 [val] declared in .Test1.equals' type=.Test1 origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test1' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test1' CONST Boolean type=kotlin.Boolean value=false WHEN type=kotlin.Unit origin=null BRANCH @@ -287,7 +287,7 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt receiver: GET_VAR ': .Test1 declared in .Test1.equals' type=.Test1 origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:shortArray type:kotlin.ShortArray visibility:private [final]' type=kotlin.ShortArray origin=null receiver: GET_VAR 'val tmp_0: .Test1 [val] declared in .Test1.equals' type=.Test1 origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test1' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test1' CONST Boolean type=kotlin.Boolean value=false WHEN type=kotlin.Unit origin=null BRANCH @@ -297,7 +297,7 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt receiver: GET_VAR ': .Test1 declared in .Test1.equals' type=.Test1 origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:intArray type:kotlin.IntArray visibility:private [final]' type=kotlin.IntArray origin=null receiver: GET_VAR 'val tmp_0: .Test1 [val] declared in .Test1.equals' type=.Test1 origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test1' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test1' CONST Boolean type=kotlin.Boolean value=false WHEN type=kotlin.Unit origin=null BRANCH @@ -307,7 +307,7 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt receiver: GET_VAR ': .Test1 declared in .Test1.equals' type=.Test1 origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:longArray type:kotlin.LongArray visibility:private [final]' type=kotlin.LongArray origin=null receiver: GET_VAR 'val tmp_0: .Test1 [val] declared in .Test1.equals' type=.Test1 origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test1' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test1' CONST Boolean type=kotlin.Boolean value=false WHEN type=kotlin.Unit origin=null BRANCH @@ -317,7 +317,7 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt receiver: GET_VAR ': .Test1 declared in .Test1.equals' type=.Test1 origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:floatArray type:kotlin.FloatArray visibility:private [final]' type=kotlin.FloatArray origin=null receiver: GET_VAR 'val tmp_0: .Test1 [val] declared in .Test1.equals' type=.Test1 origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test1' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test1' CONST Boolean type=kotlin.Boolean value=false WHEN type=kotlin.Unit origin=null BRANCH @@ -327,14 +327,14 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt receiver: GET_VAR ': .Test1 declared in .Test1.equals' type=.Test1 origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:doubleArray type:kotlin.DoubleArray visibility:private [final]' type=kotlin.DoubleArray origin=null receiver: GET_VAR 'val tmp_0: .Test1 [val] declared in .Test1.equals' type=.Test1 origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test1' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test1' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test1' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test1' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test1) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test1 + $this: VALUE_PARAMETER name: type:.Test1 BLOCK_BODY VAR name:result type:kotlin.Int [var] CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null @@ -409,7 +409,7 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test1) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test1 + $this: VALUE_PARAMETER name: type:.Test1 BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test1' STRING_CONCATENATION type=kotlin.String @@ -486,24 +486,24 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt CONSTRUCTOR_CALL 'public constructor (genericArray: kotlin.Array.Test2>) [primary] declared in .Test2' type=.Test2.Test2> origin=null : kotlin.Any genericArray: GET_VAR 'genericArray: kotlin.Array.Test2> declared in .Test2.copy' type=kotlin.Array.Test2> origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test2.Test2>, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test2.Test2>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test2.Test2> - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.Test2.Test2> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .Test2.Test2> declared in .Test2.equals' type=.Test2.Test2> origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .Test2.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test2' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test2' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.Test2.Test2> GET_VAR 'other: kotlin.Any? declared in .Test2.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test2' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test2' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:.Test2.Test2> [val] TYPE_OP type=.Test2.Test2> origin=CAST typeOperand=.Test2.Test2> @@ -516,14 +516,14 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt receiver: GET_VAR ': .Test2.Test2> declared in .Test2.equals' type=.Test2.Test2> origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:genericArray type:kotlin.Array.Test2> visibility:private [final]' type=kotlin.Array.Test2> origin=null receiver: GET_VAR 'val tmp_1: .Test2.Test2> [val] declared in .Test2.equals' type=.Test2.Test2> origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test2' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test2' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test2' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test2' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test2.Test2>) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test2.Test2> + $this: VALUE_PARAMETER name: type:.Test2.Test2> BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test2' CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null @@ -532,7 +532,7 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test2.Test2>) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test2.Test2> + $this: VALUE_PARAMETER name: type:.Test2.Test2> BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test2' STRING_CONCATENATION type=kotlin.String @@ -575,24 +575,24 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt RETURN type=kotlin.Nothing from='public final fun copy (anyArrayN: kotlin.Array?): .Test3 declared in .Test3' CONSTRUCTOR_CALL 'public constructor (anyArrayN: kotlin.Array?) [primary] declared in .Test3' type=.Test3 origin=null anyArrayN: GET_VAR 'anyArrayN: kotlin.Array? declared in .Test3.copy' type=kotlin.Array? origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test3, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test3, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test3 - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.Test3 + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .Test3 declared in .Test3.equals' type=.Test3 origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .Test3.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test3' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test3' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.Test3 GET_VAR 'other: kotlin.Any? declared in .Test3.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test3' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test3' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:.Test3 [val] TYPE_OP type=.Test3 origin=CAST typeOperand=.Test3 @@ -605,14 +605,14 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt receiver: GET_VAR ': .Test3 declared in .Test3.equals' type=.Test3 origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:anyArrayN type:kotlin.Array? visibility:private [final]' type=kotlin.Array? origin=null receiver: GET_VAR 'val tmp_2: .Test3 [val] declared in .Test3.equals' type=.Test3 origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test3' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test3' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test3' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test3' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test3) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test3 + $this: VALUE_PARAMETER name: type:.Test3 BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test3' WHEN type=kotlin.Int origin=null @@ -630,7 +630,7 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test3) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test3 + $this: VALUE_PARAMETER name: type:.Test3 BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test3' STRING_CONCATENATION type=kotlin.String diff --git a/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.fir.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.fir.kt.txt index 79356de1faa..55211b2d50f 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.fir.kt.txt @@ -81,7 +81,7 @@ data class Test1 { return Test1(stringArray = stringArray, charArray = charArray, booleanArray = booleanArray, byteArray = byteArray, shortArray = shortArray, intArray = intArray, longArray = longArray, floatArray = floatArray, doubleArray = doubleArray) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } @@ -157,7 +157,7 @@ data class Test2 { return Test2(genericArray = genericArray) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } @@ -200,7 +200,7 @@ data class Test3 { return Test3(anyArrayN = anyArrayN) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } diff --git a/compiler/testData/ir/irText/classes/dataClasses/dataClasses.fir.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/dataClasses.fir.ir.txt index 10a63191a11..a991355927d 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/dataClasses.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/dataClasses.fir.ir.txt @@ -79,24 +79,24 @@ FILE fqName: fileName:/dataClasses.kt x: GET_VAR 'x: kotlin.Int declared in .Test1.copy' type=kotlin.Int origin=null y: GET_VAR 'y: kotlin.String declared in .Test1.copy' type=kotlin.String origin=null z: GET_VAR 'z: kotlin.Any declared in .Test1.copy' type=kotlin.Any origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test1, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test1, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test1 - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.Test1 + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .Test1 declared in .Test1.equals' type=.Test1 origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .Test1.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test1' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test1' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.Test1 GET_VAR 'other: kotlin.Any? declared in .Test1.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test1' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test1' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.Test1 [val] TYPE_OP type=.Test1 origin=CAST typeOperand=.Test1 @@ -109,7 +109,7 @@ FILE fqName: fileName:/dataClasses.kt receiver: GET_VAR ': .Test1 declared in .Test1.equals' type=.Test1 origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR 'val tmp_0: .Test1 [val] declared in .Test1.equals' type=.Test1 origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test1' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test1' CONST Boolean type=kotlin.Boolean value=false WHEN type=kotlin.Unit origin=null BRANCH @@ -119,7 +119,7 @@ FILE fqName: fileName:/dataClasses.kt receiver: GET_VAR ': .Test1 declared in .Test1.equals' type=.Test1 origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR 'val tmp_0: .Test1 [val] declared in .Test1.equals' type=.Test1 origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test1' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test1' CONST Boolean type=kotlin.Boolean value=false WHEN type=kotlin.Unit origin=null BRANCH @@ -129,14 +129,14 @@ FILE fqName: fileName:/dataClasses.kt receiver: GET_VAR ': .Test1 declared in .Test1.equals' type=.Test1 origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null receiver: GET_VAR 'val tmp_0: .Test1 [val] declared in .Test1.equals' type=.Test1 origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test1' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test1' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test1' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test1' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test1) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test1 + $this: VALUE_PARAMETER name: type:.Test1 BLOCK_BODY VAR name:result type:kotlin.Int [var] CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null @@ -163,7 +163,7 @@ FILE fqName: fileName:/dataClasses.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test1) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test1 + $this: VALUE_PARAMETER name: type:.Test1 BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test1' STRING_CONCATENATION type=kotlin.String @@ -211,24 +211,24 @@ FILE fqName: fileName:/dataClasses.kt RETURN type=kotlin.Nothing from='public final fun copy (x: kotlin.Any?): .Test2 declared in .Test2' CONSTRUCTOR_CALL 'public constructor (x: kotlin.Any?) [primary] declared in .Test2' type=.Test2 origin=null x: GET_VAR 'x: kotlin.Any? declared in .Test2.copy' type=kotlin.Any? origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test2, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test2, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test2 - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.Test2 + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .Test2 declared in .Test2.equals' type=.Test2 origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .Test2.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test2' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test2' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.Test2 GET_VAR 'other: kotlin.Any? declared in .Test2.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test2' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test2' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:.Test2 [val] TYPE_OP type=.Test2 origin=CAST typeOperand=.Test2 @@ -241,14 +241,14 @@ FILE fqName: fileName:/dataClasses.kt receiver: GET_VAR ': .Test2 declared in .Test2.equals' type=.Test2 origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any? visibility:private [final]' type=kotlin.Any? origin=null receiver: GET_VAR 'val tmp_1: .Test2 [val] declared in .Test2.equals' type=.Test2 origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test2' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test2' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test2' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test2' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test2) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test2 + $this: VALUE_PARAMETER name: type:.Test2 BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test2' WHEN type=kotlin.Int origin=null @@ -266,7 +266,7 @@ FILE fqName: fileName:/dataClasses.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test2) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test2 + $this: VALUE_PARAMETER name: type:.Test2 BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test2' STRING_CONCATENATION type=kotlin.String @@ -377,24 +377,24 @@ FILE fqName: fileName:/dataClasses.kt dn: GET_VAR 'dn: kotlin.Double? declared in .Test3.copy' type=kotlin.Double? origin=null f: GET_VAR 'f: kotlin.Float declared in .Test3.copy' type=kotlin.Float origin=null df: GET_VAR 'df: kotlin.Float? declared in .Test3.copy' type=kotlin.Float? origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test3, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test3, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test3 - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.Test3 + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .Test3 declared in .Test3.equals' type=.Test3 origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .Test3.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test3' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test3' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.Test3 GET_VAR 'other: kotlin.Any? declared in .Test3.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test3' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test3' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:.Test3 [val] TYPE_OP type=.Test3 origin=CAST typeOperand=.Test3 @@ -407,7 +407,7 @@ FILE fqName: fileName:/dataClasses.kt receiver: GET_VAR ': .Test3 declared in .Test3.equals' type=.Test3 origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:d type:kotlin.Double visibility:private [final]' type=kotlin.Double origin=null receiver: GET_VAR 'val tmp_2: .Test3 [val] declared in .Test3.equals' type=.Test3 origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test3' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test3' CONST Boolean type=kotlin.Boolean value=false WHEN type=kotlin.Unit origin=null BRANCH @@ -417,7 +417,7 @@ FILE fqName: fileName:/dataClasses.kt receiver: GET_VAR ': .Test3 declared in .Test3.equals' type=.Test3 origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:dn type:kotlin.Double? visibility:private [final]' type=kotlin.Double? origin=null receiver: GET_VAR 'val tmp_2: .Test3 [val] declared in .Test3.equals' type=.Test3 origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test3' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test3' CONST Boolean type=kotlin.Boolean value=false WHEN type=kotlin.Unit origin=null BRANCH @@ -427,7 +427,7 @@ FILE fqName: fileName:/dataClasses.kt receiver: GET_VAR ': .Test3 declared in .Test3.equals' type=.Test3 origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:f type:kotlin.Float visibility:private [final]' type=kotlin.Float origin=null receiver: GET_VAR 'val tmp_2: .Test3 [val] declared in .Test3.equals' type=.Test3 origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test3' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test3' CONST Boolean type=kotlin.Boolean value=false WHEN type=kotlin.Unit origin=null BRANCH @@ -437,14 +437,14 @@ FILE fqName: fileName:/dataClasses.kt receiver: GET_VAR ': .Test3 declared in .Test3.equals' type=.Test3 origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:df type:kotlin.Float? visibility:private [final]' type=kotlin.Float? origin=null receiver: GET_VAR 'val tmp_2: .Test3 [val] declared in .Test3.equals' type=.Test3 origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test3' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test3' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test3' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test3' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test3) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test3 + $this: VALUE_PARAMETER name: type:.Test3 BLOCK_BODY VAR name:result type:kotlin.Int [var] CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Double' type=kotlin.Int origin=null @@ -497,7 +497,7 @@ FILE fqName: fileName:/dataClasses.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test3) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test3 + $this: VALUE_PARAMETER name: type:.Test3 BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test3' STRING_CONCATENATION type=kotlin.String diff --git a/compiler/testData/ir/irText/classes/dataClasses/dataClasses.fir.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/dataClasses.fir.kt.txt index 860e0c95bec..d6e0f2693d9 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/dataClasses.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/dataClasses.fir.kt.txt @@ -33,7 +33,7 @@ data class Test1 { return Test1(x = x, y = y, z = z) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } @@ -85,7 +85,7 @@ data class Test2 { return Test2(x = x) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } @@ -155,7 +155,7 @@ data class Test3 { return Test3(d = d, dn = dn, f = f, df = df) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } diff --git a/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.fir.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.fir.ir.txt index 3a0a1cb7226..c040e814234 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.fir.ir.txt @@ -35,24 +35,24 @@ FILE fqName: fileName:/dataClassesGeneric.kt CONSTRUCTOR_CALL 'public constructor (x: T of .Test1) [primary] declared in .Test1' type=.Test1.Test1> origin=null : kotlin.Any x: GET_VAR 'x: T of .Test1 declared in .Test1.copy' type=T of .Test1 origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test1.Test1>, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test1.Test1>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test1.Test1> - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.Test1.Test1> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .Test1.Test1> declared in .Test1.equals' type=.Test1.Test1> origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .Test1.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test1' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test1' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.Test1.Test1> GET_VAR 'other: kotlin.Any? declared in .Test1.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test1' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test1' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.Test1.Test1> [val] TYPE_OP type=.Test1.Test1> origin=CAST typeOperand=.Test1.Test1> @@ -65,14 +65,14 @@ FILE fqName: fileName:/dataClassesGeneric.kt receiver: GET_VAR ': .Test1.Test1> declared in .Test1.equals' type=.Test1.Test1> origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test1 visibility:private [final]' type=T of .Test1 origin=null receiver: GET_VAR 'val tmp_0: .Test1.Test1> [val] declared in .Test1.equals' type=.Test1.Test1> origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test1' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test1' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test1' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test1' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test1.Test1>) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test1.Test1> + $this: VALUE_PARAMETER name: type:.Test1.Test1> BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test1' WHEN type=kotlin.Int origin=null @@ -90,7 +90,7 @@ FILE fqName: fileName:/dataClassesGeneric.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test1.Test1>) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test1.Test1> + $this: VALUE_PARAMETER name: type:.Test1.Test1> BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test1' STRING_CONCATENATION type=kotlin.String @@ -134,24 +134,24 @@ FILE fqName: fileName:/dataClassesGeneric.kt CONSTRUCTOR_CALL 'public constructor (x: T of .Test2) [primary] declared in .Test2' type=.Test2.Test2> origin=null : kotlin.Any x: GET_VAR 'x: T of .Test2 declared in .Test2.copy' type=T of .Test2 origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test2.Test2>, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test2.Test2>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test2.Test2> - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.Test2.Test2> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .Test2.Test2> declared in .Test2.equals' type=.Test2.Test2> origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .Test2.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test2' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test2' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.Test2.Test2> GET_VAR 'other: kotlin.Any? declared in .Test2.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test2' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test2' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:.Test2.Test2> [val] TYPE_OP type=.Test2.Test2> origin=CAST typeOperand=.Test2.Test2> @@ -164,14 +164,14 @@ FILE fqName: fileName:/dataClassesGeneric.kt receiver: GET_VAR ': .Test2.Test2> declared in .Test2.equals' type=.Test2.Test2> origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test2 visibility:private [final]' type=T of .Test2 origin=null receiver: GET_VAR 'val tmp_1: .Test2.Test2> [val] declared in .Test2.equals' type=.Test2.Test2> origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test2' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test2' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test2' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test2' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test2.Test2>) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test2.Test2> + $this: VALUE_PARAMETER name: type:.Test2.Test2> BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test2' CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Number' type=kotlin.Int origin=null @@ -180,7 +180,7 @@ FILE fqName: fileName:/dataClassesGeneric.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test2.Test2>) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test2.Test2> + $this: VALUE_PARAMETER name: type:.Test2.Test2> BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test2' STRING_CONCATENATION type=kotlin.String @@ -224,24 +224,24 @@ FILE fqName: fileName:/dataClassesGeneric.kt CONSTRUCTOR_CALL 'public constructor (x: kotlin.collections.List.Test3>) [primary] declared in .Test3' type=.Test3.Test3> origin=null : kotlin.Any x: GET_VAR 'x: kotlin.collections.List.Test3> declared in .Test3.copy' type=kotlin.collections.List.Test3> origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test3.Test3>, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test3.Test3>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test3.Test3> - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.Test3.Test3> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .Test3.Test3> declared in .Test3.equals' type=.Test3.Test3> origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .Test3.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test3' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test3' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.Test3.Test3> GET_VAR 'other: kotlin.Any? declared in .Test3.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test3' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test3' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:.Test3.Test3> [val] TYPE_OP type=.Test3.Test3> origin=CAST typeOperand=.Test3.Test3> @@ -254,14 +254,14 @@ FILE fqName: fileName:/dataClassesGeneric.kt receiver: GET_VAR ': .Test3.Test3> declared in .Test3.equals' type=.Test3.Test3> origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.collections.List.Test3> visibility:private [final]' type=kotlin.collections.List.Test3> origin=null receiver: GET_VAR 'val tmp_2: .Test3.Test3> [val] declared in .Test3.equals' type=.Test3.Test3> origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test3' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test3' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test3' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test3' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test3.Test3>) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test3.Test3> + $this: VALUE_PARAMETER name: type:.Test3.Test3> BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test3' CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.collections.List' type=kotlin.Int origin=null @@ -270,7 +270,7 @@ FILE fqName: fileName:/dataClassesGeneric.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test3.Test3>) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test3.Test3> + $this: VALUE_PARAMETER name: type:.Test3.Test3> BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test3' STRING_CONCATENATION type=kotlin.String @@ -312,24 +312,24 @@ FILE fqName: fileName:/dataClassesGeneric.kt RETURN type=kotlin.Nothing from='public final fun copy (x: kotlin.collections.List): .Test4 declared in .Test4' CONSTRUCTOR_CALL 'public constructor (x: kotlin.collections.List) [primary] declared in .Test4' type=.Test4 origin=null x: GET_VAR 'x: kotlin.collections.List declared in .Test4.copy' type=kotlin.collections.List origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test4, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test4, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test4 - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.Test4 + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .Test4 declared in .Test4.equals' type=.Test4 origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .Test4.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test4' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test4' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.Test4 GET_VAR 'other: kotlin.Any? declared in .Test4.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test4' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test4' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:.Test4 [val] TYPE_OP type=.Test4 origin=CAST typeOperand=.Test4 @@ -342,14 +342,14 @@ FILE fqName: fileName:/dataClassesGeneric.kt receiver: GET_VAR ': .Test4 declared in .Test4.equals' type=.Test4 origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.collections.List visibility:private [final]' type=kotlin.collections.List origin=null receiver: GET_VAR 'val tmp_3: .Test4 [val] declared in .Test4.equals' type=.Test4 origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test4' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test4' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test4' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test4' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test4) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test4 + $this: VALUE_PARAMETER name: type:.Test4 BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test4' CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.collections.List' type=kotlin.Int origin=null @@ -358,7 +358,7 @@ FILE fqName: fileName:/dataClassesGeneric.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test4) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test4 + $this: VALUE_PARAMETER name: type:.Test4 BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test4' STRING_CONCATENATION type=kotlin.String diff --git a/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.fir.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.fir.kt.txt index fe75bd56ed3..5b713f124b2 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.fir.kt.txt @@ -17,7 +17,7 @@ data class Test1 { return Test1(x = x) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } @@ -63,7 +63,7 @@ data class Test2 { return Test2(x = x) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } @@ -106,7 +106,7 @@ data class Test3 { return Test3(x = x) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } @@ -149,7 +149,7 @@ data class Test4 { return Test4(x = x) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } diff --git a/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.ir.txt index 1ec6faad811..dfad395c3b6 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.ir.txt @@ -82,24 +82,24 @@ FILE fqName: fileName:/delegationInSealed.kt RETURN type=kotlin.Nothing from='public final fun copy (c: kotlin.CharSequence): .A.B declared in .A.B' CONSTRUCTOR_CALL 'public constructor (c: kotlin.CharSequence) [primary] declared in .A.B' type=.A.B origin=null c: GET_VAR 'c: kotlin.CharSequence declared in .A.B.copy' type=kotlin.CharSequence origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.A.B, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.A.B, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.A.B - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.A.B + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .A.B declared in .A.B.equals' type=.A.B origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .A.B.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A.B' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .A.B' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.A.B GET_VAR 'other: kotlin.Any? declared in .A.B.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A.B' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .A.B' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.A.B [val] TYPE_OP type=.A.B origin=CAST typeOperand=.A.B @@ -112,14 +112,14 @@ FILE fqName: fileName:/delegationInSealed.kt receiver: GET_VAR ': .A.B declared in .A.B.equals' type=.A.B origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.CharSequence visibility:private [final]' type=kotlin.CharSequence origin=null receiver: GET_VAR 'val tmp_0: .A.B [val] declared in .A.B.equals' type=.A.B origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A.B' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .A.B' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A.B' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .A.B' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.A.B) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.A.B + $this: VALUE_PARAMETER name: type:.A.B BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .A.B' CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.CharSequence' type=kotlin.Int origin=null @@ -128,7 +128,7 @@ FILE fqName: fileName:/delegationInSealed.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.A.B) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.A.B + $this: VALUE_PARAMETER name: type:.A.B BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .A.B' STRING_CONCATENATION type=kotlin.String diff --git a/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.kt.txt index 47a66a6ca1c..810452d5955 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.kt.txt @@ -37,7 +37,7 @@ sealed class A : CharSequence { return B(c = c) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } diff --git a/compiler/testData/ir/irText/classes/dataClasses/kt31649.fir.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/kt31649.fir.ir.txt index d0eb2880d54..4fa89f4dad8 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/kt31649.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/kt31649.fir.ir.txt @@ -33,24 +33,24 @@ FILE fqName: fileName:/kt31649.kt RETURN type=kotlin.Nothing from='public final fun copy (nn: kotlin.Nothing?): .TestData declared in .TestData' CONSTRUCTOR_CALL 'public constructor (nn: kotlin.Nothing?) [primary] declared in .TestData' type=.TestData origin=null nn: GET_VAR 'nn: kotlin.Nothing? declared in .TestData.copy' type=kotlin.Nothing? origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.TestData, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.TestData, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.TestData - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.TestData + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .TestData declared in .TestData.equals' type=.TestData origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .TestData.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .TestData' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .TestData' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.TestData GET_VAR 'other: kotlin.Any? declared in .TestData.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .TestData' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .TestData' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.TestData [val] TYPE_OP type=.TestData origin=CAST typeOperand=.TestData @@ -63,14 +63,14 @@ FILE fqName: fileName:/kt31649.kt receiver: GET_VAR ': .TestData declared in .TestData.equals' type=.TestData origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nn type:kotlin.Nothing? visibility:private [final]' type=kotlin.Nothing? origin=null receiver: GET_VAR 'val tmp_0: .TestData [val] declared in .TestData.equals' type=.TestData origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .TestData' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .TestData' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .TestData' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .TestData' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.TestData) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.TestData + $this: VALUE_PARAMETER name: type:.TestData BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .TestData' WHEN type=kotlin.Int origin=null @@ -88,7 +88,7 @@ FILE fqName: fileName:/kt31649.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.TestData) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.TestData + $this: VALUE_PARAMETER name: type:.TestData BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .TestData' STRING_CONCATENATION type=kotlin.String @@ -114,17 +114,17 @@ FILE fqName: fileName:/kt31649.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Nothing? declared in .TestInline' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nn type:kotlin.Nothing? visibility:private [final]' type=kotlin.Nothing? origin=null receiver: GET_VAR ': .TestInline declared in .TestInline.' type=.TestInline origin=null - FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.TestInline, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.TestInline, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name: type:.TestInline - VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.TestInline + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.TestInline GET_VAR 'other: kotlin.Any? declared in .TestInline.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .TestInline' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .TestInline' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:.TestInline [val] TYPE_OP type=.TestInline origin=CAST typeOperand=.TestInline @@ -137,14 +137,14 @@ FILE fqName: fileName:/kt31649.kt receiver: GET_VAR ': .TestInline declared in .TestInline.equals' type=.TestInline origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:nn type:kotlin.Nothing? visibility:private [final]' type=kotlin.Nothing? origin=null receiver: GET_VAR 'val tmp_1: .TestInline [val] declared in .TestInline.equals' type=.TestInline origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .TestInline' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .TestInline' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .TestInline' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .TestInline' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.TestInline) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name: type:.TestInline + $this: VALUE_PARAMETER name: type:.TestInline BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .TestInline' WHEN type=kotlin.Int origin=null @@ -162,7 +162,7 @@ FILE fqName: fileName:/kt31649.kt FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.TestInline) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name: type:.TestInline + $this: VALUE_PARAMETER name: type:.TestInline BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .TestInline' STRING_CONCATENATION type=kotlin.String diff --git a/compiler/testData/ir/irText/classes/dataClasses/kt31649.fir.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/kt31649.fir.kt.txt index 620dd95de1a..d5026228662 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/kt31649.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/kt31649.fir.kt.txt @@ -17,7 +17,7 @@ data class TestData { return TestData(nn = nn) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } @@ -55,7 +55,7 @@ value class TestInline { field = nn get - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { other !is TestInline -> return false } diff --git a/compiler/testData/ir/irText/classes/dataClasses/kt49936.fir.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/kt49936.fir.ir.txt index 56a6b2f5b3c..c3c7a2e7352 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/kt49936.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/kt49936.fir.ir.txt @@ -41,24 +41,24 @@ FILE fqName: fileName:/kt49936.kt RETURN type=kotlin.Nothing from='public final fun copy (x: kotlin.Int): .A declared in .A' CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int) [primary] declared in .A' type=.A origin=null x: GET_VAR 'x: kotlin.Int declared in .A.copy' type=kotlin.Int origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.A, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.A, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.A - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.A + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .A declared in .A.equals' type=.A origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .A.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .A' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.A GET_VAR 'other: kotlin.Any? declared in .A.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .A' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.A [val] TYPE_OP type=.A origin=CAST typeOperand=.A @@ -71,14 +71,14 @@ FILE fqName: fileName:/kt49936.kt receiver: GET_VAR ': .A declared in .A.equals' type=.A origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR 'val tmp_0: .A [val] declared in .A.equals' type=.A origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .A' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .A' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.A + $this: VALUE_PARAMETER name: type:.A BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .A' CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null @@ -87,7 +87,7 @@ FILE fqName: fileName:/kt49936.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.A + $this: VALUE_PARAMETER name: type:.A BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .A' STRING_CONCATENATION type=kotlin.String diff --git a/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.ir.txt index d2ef8f95e5e..8e10c97c3f1 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.ir.txt @@ -41,24 +41,24 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt RETURN type=kotlin.Nothing from='public final fun copy (runA: @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit>): .A declared in .A' CONSTRUCTOR_CALL 'public constructor (runA: @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit>) [primary] declared in .A' type=.A origin=null runA: GET_VAR 'runA: @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> declared in .A.copy' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.A, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.A, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.A - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.A + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .A declared in .A.equals' type=.A origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .A.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .A' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.A GET_VAR 'other: kotlin.Any? declared in .A.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .A' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.A [val] TYPE_OP type=.A origin=CAST typeOperand=.A @@ -71,14 +71,14 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt receiver: GET_VAR ': .A declared in .A.equals' type=.A origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:runA type:@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> visibility:private [final]' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null receiver: GET_VAR 'val tmp_0: .A [val] declared in .A.equals' type=.A origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .A' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .A' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.A + $this: VALUE_PARAMETER name: type:.A BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .A' CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Function2' type=kotlin.Int origin=null @@ -87,7 +87,7 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.A + $this: VALUE_PARAMETER name: type:.A BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .A' STRING_CONCATENATION type=kotlin.String @@ -151,24 +151,24 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt RETURN type=kotlin.Nothing from='public final fun copy (x: kotlin.Any): .B declared in .B' CONSTRUCTOR_CALL 'public constructor (x: kotlin.Any) [primary] declared in .B' type=.B origin=null x: GET_VAR 'x: kotlin.Any declared in .B.copy' type=kotlin.Any origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.B, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.B, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.B - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.B + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .B declared in .B.equals' type=.B origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .B.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .B' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .B' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.B GET_VAR 'other: kotlin.Any? declared in .B.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .B' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .B' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:.B [val] TYPE_OP type=.B origin=CAST typeOperand=.B @@ -181,14 +181,14 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt receiver: GET_VAR ': .B declared in .B.equals' type=.B origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null receiver: GET_VAR 'val tmp_1: .B [val] declared in .B.equals' type=.B origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .B' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .B' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .B' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .B' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.B) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.B + $this: VALUE_PARAMETER name: type:.B BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .B' CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null @@ -197,7 +197,7 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.B) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.B + $this: VALUE_PARAMETER name: type:.B BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .B' STRING_CONCATENATION type=kotlin.String diff --git a/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.kt.txt index a105fca2c6b..edf9c25d05a 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.kt.txt @@ -20,7 +20,7 @@ data class A { return A(runA = runA) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } @@ -74,7 +74,7 @@ data class B { return B(x = x) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } diff --git a/compiler/testData/ir/irText/classes/dataClasses/openDataClass.fir.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/openDataClass.fir.ir.txt index b54278b772f..31c6a1a7fb0 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/openDataClass.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/openDataClass.fir.ir.txt @@ -58,24 +58,24 @@ FILE fqName: fileName:/openDataClass.kt CONSTRUCTOR_CALL 'public constructor (test1: kotlin.String, test2: kotlin.String) [primary] declared in .ValidatedProperties' type=.ValidatedProperties origin=null test1: GET_VAR 'test1: kotlin.String declared in .ValidatedProperties.copy' type=kotlin.String origin=null test2: GET_VAR 'test2: kotlin.String declared in .ValidatedProperties.copy' type=kotlin.String origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.ValidatedProperties, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.ValidatedProperties, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.ValidatedProperties - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.ValidatedProperties + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .ValidatedProperties declared in .ValidatedProperties.equals' type=.ValidatedProperties origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .ValidatedProperties.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ValidatedProperties' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .ValidatedProperties' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.ValidatedProperties GET_VAR 'other: kotlin.Any? declared in .ValidatedProperties.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ValidatedProperties' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .ValidatedProperties' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.ValidatedProperties [val] TYPE_OP type=.ValidatedProperties origin=CAST typeOperand=.ValidatedProperties @@ -88,7 +88,7 @@ FILE fqName: fileName:/openDataClass.kt $this: GET_VAR ': .ValidatedProperties declared in .ValidatedProperties.equals' type=.ValidatedProperties origin=null arg1: CALL 'public open fun (): kotlin.String declared in .ValidatedProperties' type=kotlin.String origin=null $this: GET_VAR 'val tmp_0: .ValidatedProperties [val] declared in .ValidatedProperties.equals' type=.ValidatedProperties origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ValidatedProperties' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .ValidatedProperties' CONST Boolean type=kotlin.Boolean value=false WHEN type=kotlin.Unit origin=null BRANCH @@ -98,14 +98,14 @@ FILE fqName: fileName:/openDataClass.kt $this: GET_VAR ': .ValidatedProperties declared in .ValidatedProperties.equals' type=.ValidatedProperties origin=null arg1: CALL 'public open fun (): kotlin.String declared in .ValidatedProperties' type=kotlin.String origin=null $this: GET_VAR 'val tmp_0: .ValidatedProperties [val] declared in .ValidatedProperties.equals' type=.ValidatedProperties origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ValidatedProperties' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .ValidatedProperties' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ValidatedProperties' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .ValidatedProperties' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.ValidatedProperties) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.ValidatedProperties + $this: VALUE_PARAMETER name: type:.ValidatedProperties BLOCK_BODY VAR name:result type:kotlin.Int [var] CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.String' type=kotlin.Int origin=null @@ -124,7 +124,7 @@ FILE fqName: fileName:/openDataClass.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.ValidatedProperties) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.ValidatedProperties + $this: VALUE_PARAMETER name: type:.ValidatedProperties BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .ValidatedProperties' STRING_CONCATENATION type=kotlin.String diff --git a/compiler/testData/ir/irText/classes/dataClasses/openDataClass.fir.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/openDataClass.fir.kt.txt index 1ff6c00bba4..df2e708d446 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/openDataClass.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/openDataClass.fir.kt.txt @@ -26,7 +26,7 @@ open data class ValidatedProperties { return ValidatedProperties(test1 = test1, test2 = test2) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } diff --git a/compiler/testData/ir/irText/classes/inlineClass.fir.ir.txt b/compiler/testData/ir/irText/classes/inlineClass.fir.ir.txt index bbf189aa1e8..8ea3e588ad7 100644 --- a/compiler/testData/ir/irText/classes/inlineClass.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/inlineClass.fir.ir.txt @@ -17,17 +17,17 @@ FILE fqName: fileName:/inlineClass.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Test declared in .Test.' type=.Test origin=null - FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name: type:.Test - VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.Test + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.Test GET_VAR 'other: kotlin.Any? declared in .Test.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.Test [val] TYPE_OP type=.Test origin=CAST typeOperand=.Test @@ -40,14 +40,14 @@ FILE fqName: fileName:/inlineClass.kt receiver: GET_VAR ': .Test declared in .Test.equals' type=.Test origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR 'val tmp_0: .Test [val] declared in .Test.equals' type=.Test origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name: type:.Test + $this: VALUE_PARAMETER name: type:.Test BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test' CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null @@ -56,7 +56,7 @@ FILE fqName: fileName:/inlineClass.kt FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name: type:.Test + $this: VALUE_PARAMETER name: type:.Test BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test' STRING_CONCATENATION type=kotlin.String diff --git a/compiler/testData/ir/irText/classes/inlineClass.fir.kt.txt b/compiler/testData/ir/irText/classes/inlineClass.fir.kt.txt index a6ad5fee165..3c98ba9957b 100644 --- a/compiler/testData/ir/irText/classes/inlineClass.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/inlineClass.fir.kt.txt @@ -9,7 +9,7 @@ value class Test { field = x get - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { other !is Test -> return false } diff --git a/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.fir.ir.txt b/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.fir.ir.txt index 4a051babff1..334c6581bf5 100644 --- a/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.fir.ir.txt @@ -62,17 +62,17 @@ FILE fqName: fileName:/inlineClassSyntheticMethods.kt CALL 'public open fun hashCode (): kotlin.Int declared in .C' type=kotlin.Int origin=null $this: CALL 'public final fun (): .C.IC> declared in .IC' type=.C.IC> origin=GET_PROPERTY $this: GET_VAR ': .IC.IC> declared in .IC.foo' type=.IC.IC> origin=null - FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.IC.IC>, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.IC.IC>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name: type:.IC.IC> - VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.IC.IC> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.IC.IC> GET_VAR 'other: kotlin.Any? declared in .IC.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IC' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .IC' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.IC.IC> [val] TYPE_OP type=.IC.IC> origin=CAST typeOperand=.IC.IC> @@ -85,14 +85,14 @@ FILE fqName: fileName:/inlineClassSyntheticMethods.kt receiver: GET_VAR ': .IC.IC> declared in .IC.equals' type=.IC.IC> origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:.C.IC> visibility:private [final]' type=.C.IC> origin=null receiver: GET_VAR 'val tmp_0: .IC.IC> [val] declared in .IC.equals' type=.IC.IC> origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IC' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .IC' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IC' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .IC' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.IC.IC>) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name: type:.IC.IC> + $this: VALUE_PARAMETER name: type:.IC.IC> BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .IC' CALL 'public open fun hashCode (): kotlin.Int declared in .C' type=kotlin.Int origin=null @@ -101,7 +101,7 @@ FILE fqName: fileName:/inlineClassSyntheticMethods.kt FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.IC.IC>) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name: type:.IC.IC> + $this: VALUE_PARAMETER name: type:.IC.IC> BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .IC' STRING_CONCATENATION type=kotlin.String diff --git a/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.fir.kt.txt b/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.fir.kt.txt index fe5663ad27a..8748ba28319 100644 --- a/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.fir.kt.txt @@ -30,7 +30,7 @@ value class IC { return .().hashCode() } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { other !is IC -> return false } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.ir.txt index afe414bddef..4d49168eaec 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.ir.txt @@ -41,24 +41,24 @@ FILE fqName: fileName:/arrayAccessCompositeOperators.kt RETURN type=kotlin.Nothing from='public final fun copy (i: kotlin.Int): .MyContainer declared in .MyContainer' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .MyContainer' type=.MyContainer origin=null i: GET_VAR 'i: kotlin.Int declared in .MyContainer.copy' type=kotlin.Int origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.MyContainer, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.MyContainer, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.MyContainer - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.MyContainer + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .MyContainer declared in .MyContainer.equals' type=.MyContainer origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .MyContainer.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyContainer' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .MyContainer' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.MyContainer GET_VAR 'other: kotlin.Any? declared in .MyContainer.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyContainer' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .MyContainer' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.MyContainer [val] TYPE_OP type=.MyContainer origin=CAST typeOperand=.MyContainer @@ -71,14 +71,14 @@ FILE fqName: fileName:/arrayAccessCompositeOperators.kt receiver: GET_VAR ': .MyContainer declared in .MyContainer.equals' type=.MyContainer origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null receiver: GET_VAR 'val tmp_0: .MyContainer [val] declared in .MyContainer.equals' type=.MyContainer origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyContainer' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .MyContainer' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyContainer' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .MyContainer' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.MyContainer) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.MyContainer + $this: VALUE_PARAMETER name: type:.MyContainer BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .MyContainer' CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null @@ -87,7 +87,7 @@ FILE fqName: fileName:/arrayAccessCompositeOperators.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.MyContainer) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.MyContainer + $this: VALUE_PARAMETER name: type:.MyContainer BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .MyContainer' STRING_CONCATENATION type=kotlin.String diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.kt.txt index 324c09a7a85..4eb2b95cb1d 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessCompositeOperators.fir.kt.txt @@ -18,7 +18,7 @@ data class MyContainer { return MyContainer(i = i) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.ir.txt index 44b5c2a1e87..91a59d5888f 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.ir.txt @@ -41,24 +41,24 @@ FILE fqName: fileName:/arrayAccessOperators.kt RETURN type=kotlin.Nothing from='public final fun copy (s: kotlin.String): .MyContainer declared in .MyContainer' CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) [primary] declared in .MyContainer' type=.MyContainer origin=null s: GET_VAR 's: kotlin.String declared in .MyContainer.copy' type=kotlin.String origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.MyContainer, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.MyContainer, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.MyContainer - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.MyContainer + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .MyContainer declared in .MyContainer.equals' type=.MyContainer origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .MyContainer.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyContainer' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .MyContainer' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.MyContainer GET_VAR 'other: kotlin.Any? declared in .MyContainer.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyContainer' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .MyContainer' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.MyContainer [val] TYPE_OP type=.MyContainer origin=CAST typeOperand=.MyContainer @@ -71,14 +71,14 @@ FILE fqName: fileName:/arrayAccessOperators.kt receiver: GET_VAR ': .MyContainer declared in .MyContainer.equals' type=.MyContainer origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private' type=kotlin.String origin=null receiver: GET_VAR 'val tmp_0: .MyContainer [val] declared in .MyContainer.equals' type=.MyContainer origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyContainer' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .MyContainer' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyContainer' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .MyContainer' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.MyContainer) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.MyContainer + $this: VALUE_PARAMETER name: type:.MyContainer BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .MyContainer' CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.String' type=kotlin.Int origin=null @@ -87,7 +87,7 @@ FILE fqName: fileName:/arrayAccessOperators.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.MyContainer) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.MyContainer + $this: VALUE_PARAMETER name: type:.MyContainer BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .MyContainer' STRING_CONCATENATION type=kotlin.String diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.kt.txt index 6dc37958633..6e44a205a52 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/arrayAccessOperators.fir.kt.txt @@ -18,7 +18,7 @@ data class MyContainer { return MyContainer(s = s) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.ir.txt index 707b7a0df7d..3a8de1b5bad 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.ir.txt @@ -41,24 +41,24 @@ FILE fqName: fileName:/compoundAssignmentOperators.kt RETURN type=kotlin.Nothing from='public final fun copy (i: kotlin.Int): .Result declared in .Result' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: GET_VAR 'i: kotlin.Int declared in .Result.copy' type=kotlin.Int origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Result, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Result, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Result - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.Result + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .Result declared in .Result.equals' type=.Result origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .Result.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Result' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Result' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.Result GET_VAR 'other: kotlin.Any? declared in .Result.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Result' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Result' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.Result [val] TYPE_OP type=.Result origin=CAST typeOperand=.Result @@ -71,14 +71,14 @@ FILE fqName: fileName:/compoundAssignmentOperators.kt receiver: GET_VAR ': .Result declared in .Result.equals' type=.Result origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null receiver: GET_VAR 'val tmp_0: .Result [val] declared in .Result.equals' type=.Result origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Result' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Result' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Result' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Result' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Result) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Result + $this: VALUE_PARAMETER name: type:.Result BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Result' CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null @@ -87,7 +87,7 @@ FILE fqName: fileName:/compoundAssignmentOperators.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Result) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Result + $this: VALUE_PARAMETER name: type:.Result BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Result' STRING_CONCATENATION type=kotlin.String diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.kt.txt index b36952aa74e..278afae306a 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/compoundAssignmentOperators.fir.kt.txt @@ -18,7 +18,7 @@ data class Result { return Result(i = i) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.ir.txt index 0f0f799ee2d..ddcefedd046 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.ir.txt @@ -60,24 +60,24 @@ FILE fqName: fileName:/compareTo.kt : kotlin.Any first: GET_VAR 'first: A of .Pair declared in .Pair.copy' type=A of .Pair origin=null second: GET_VAR 'second: B of .Pair declared in .Pair.copy' type=B of .Pair origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Pair.Pair, B of .Pair>, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Pair.Pair, B of .Pair>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Pair.Pair, B of .Pair> - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.Pair.Pair, B of .Pair> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.equals' type=.Pair.Pair, B of .Pair> origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .Pair.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Pair' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Pair' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.Pair.Pair, B of .Pair> GET_VAR 'other: kotlin.Any? declared in .Pair.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Pair' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Pair' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.Pair.Pair, B of .Pair> [val] TYPE_OP type=.Pair.Pair, B of .Pair> origin=CAST typeOperand=.Pair.Pair, B of .Pair> @@ -90,7 +90,7 @@ FILE fqName: fileName:/compareTo.kt receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.equals' type=.Pair.Pair, B of .Pair> origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:first type:A of .Pair visibility:private [final]' type=A of .Pair origin=null receiver: GET_VAR 'val tmp_0: .Pair.Pair, B of .Pair> [val] declared in .Pair.equals' type=.Pair.Pair, B of .Pair> origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Pair' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Pair' CONST Boolean type=kotlin.Boolean value=false WHEN type=kotlin.Unit origin=null BRANCH @@ -100,14 +100,14 @@ FILE fqName: fileName:/compareTo.kt receiver: GET_VAR ': .Pair.Pair, B of .Pair> declared in .Pair.equals' type=.Pair.Pair, B of .Pair> origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:second type:B of .Pair visibility:private [final]' type=B of .Pair origin=null receiver: GET_VAR 'val tmp_0: .Pair.Pair, B of .Pair> [val] declared in .Pair.equals' type=.Pair.Pair, B of .Pair> origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Pair' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Pair' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Pair' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Pair' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Pair.Pair, B of .Pair>) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Pair.Pair, B of .Pair> + $this: VALUE_PARAMETER name: type:.Pair.Pair, B of .Pair> BLOCK_BODY VAR name:result type:kotlin.Int [var] WHEN type=kotlin.Int origin=null @@ -144,7 +144,7 @@ FILE fqName: fileName:/compareTo.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Pair.Pair, B of .Pair>) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Pair.Pair, B of .Pair> + $this: VALUE_PARAMETER name: type:.Pair.Pair, B of .Pair> BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Pair' STRING_CONCATENATION type=kotlin.String diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.kt.txt index 8aa5ed01bda..da17cb84ece 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.fir.kt.txt @@ -25,7 +25,7 @@ data class Pair { return Pair(first = first, second = second) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.ir.txt index 6ef5b97bd44..5f82dcaf15a 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.ir.txt @@ -43,24 +43,24 @@ FILE fqName: fileName:/iteratorOperator.kt RETURN type=kotlin.Nothing from='public final fun copy (i: kotlin.Int): .Counter declared in .Counter' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Counter' type=.Counter origin=null i: GET_VAR 'i: kotlin.Int declared in .Counter.copy' type=kotlin.Int origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Counter, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Counter, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Counter - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.Counter + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .Counter declared in .Counter.equals' type=.Counter origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .Counter.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Counter' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Counter' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.Counter GET_VAR 'other: kotlin.Any? declared in .Counter.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Counter' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Counter' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.Counter [val] TYPE_OP type=.Counter origin=CAST typeOperand=.Counter @@ -73,14 +73,14 @@ FILE fqName: fileName:/iteratorOperator.kt receiver: GET_VAR ': .Counter declared in .Counter.equals' type=.Counter origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null receiver: GET_VAR 'val tmp_0: .Counter [val] declared in .Counter.equals' type=.Counter origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Counter' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Counter' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Counter' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Counter' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Counter) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Counter + $this: VALUE_PARAMETER name: type:.Counter BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Counter' CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null @@ -89,7 +89,7 @@ FILE fqName: fileName:/iteratorOperator.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Counter) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Counter + $this: VALUE_PARAMETER name: type:.Counter BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Counter' STRING_CONCATENATION type=kotlin.String @@ -133,24 +133,24 @@ FILE fqName: fileName:/iteratorOperator.kt RETURN type=kotlin.Nothing from='public final fun copy (max: kotlin.Int): .CounterConfig declared in .CounterConfig' CONSTRUCTOR_CALL 'public constructor (max: kotlin.Int) [primary] declared in .CounterConfig' type=.CounterConfig origin=null max: GET_VAR 'max: kotlin.Int declared in .CounterConfig.copy' type=kotlin.Int origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.CounterConfig, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.CounterConfig, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.CounterConfig - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.CounterConfig + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .CounterConfig declared in .CounterConfig.equals' type=.CounterConfig origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .CounterConfig.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .CounterConfig' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .CounterConfig' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.CounterConfig GET_VAR 'other: kotlin.Any? declared in .CounterConfig.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .CounterConfig' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .CounterConfig' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:.CounterConfig [val] TYPE_OP type=.CounterConfig origin=CAST typeOperand=.CounterConfig @@ -163,14 +163,14 @@ FILE fqName: fileName:/iteratorOperator.kt receiver: GET_VAR ': .CounterConfig declared in .CounterConfig.equals' type=.CounterConfig origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:max type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR 'val tmp_1: .CounterConfig [val] declared in .CounterConfig.equals' type=.CounterConfig origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .CounterConfig' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .CounterConfig' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .CounterConfig' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .CounterConfig' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.CounterConfig) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.CounterConfig + $this: VALUE_PARAMETER name: type:.CounterConfig BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .CounterConfig' CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null @@ -179,7 +179,7 @@ FILE fqName: fileName:/iteratorOperator.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.CounterConfig) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.CounterConfig + $this: VALUE_PARAMETER name: type:.CounterConfig BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .CounterConfig' STRING_CONCATENATION type=kotlin.String diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.kt.txt index 70fc98d5058..466d67c935d 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/iteratorOperator.fir.kt.txt @@ -18,7 +18,7 @@ data class Counter { return Counter(i = i) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } @@ -61,7 +61,7 @@ data class CounterConfig { return CounterConfig(max = max) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.ir.txt index 47a23ce29c0..6f59ac698be 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.ir.txt @@ -33,24 +33,24 @@ FILE fqName: fileName:/unaryOperators.kt RETURN type=kotlin.Nothing from='public final fun copy (i: kotlin.Int): .Result declared in .Result' CONSTRUCTOR_CALL 'public constructor (i: kotlin.Int) [primary] declared in .Result' type=.Result origin=null i: GET_VAR 'i: kotlin.Int declared in .Result.copy' type=kotlin.Int origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Result, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Result, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Result - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.Result + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .Result declared in .Result.equals' type=.Result origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .Result.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Result' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Result' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.Result GET_VAR 'other: kotlin.Any? declared in .Result.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Result' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Result' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.Result [val] TYPE_OP type=.Result origin=CAST typeOperand=.Result @@ -63,14 +63,14 @@ FILE fqName: fileName:/unaryOperators.kt receiver: GET_VAR ': .Result declared in .Result.equals' type=.Result origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR 'val tmp_0: .Result [val] declared in .Result.equals' type=.Result origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Result' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Result' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Result' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Result' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Result) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Result + $this: VALUE_PARAMETER name: type:.Result BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Result' CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null @@ -79,7 +79,7 @@ FILE fqName: fileName:/unaryOperators.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Result) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Result + $this: VALUE_PARAMETER name: type:.Result BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Result' STRING_CONCATENATION type=kotlin.String diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.kt.txt index baec71e984a..6cacc13fe2a 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/unaryOperators.fir.kt.txt @@ -17,7 +17,7 @@ data class Result { return Result(i = i) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } diff --git a/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.fir.ir.txt b/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.fir.ir.txt index d46917c4316..76c1a8d1252 100644 --- a/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.fir.ir.txt @@ -17,17 +17,17 @@ FILE fqName: fileName:/inlineCollectionOfInlineClass.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .IT' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .IT declared in .IT.' type=.IT origin=null - FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.IT, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.IT, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name: type:.IT - VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.IT + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.IT GET_VAR 'other: kotlin.Any? declared in .IT.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IT' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .IT' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.IT [val] TYPE_OP type=.IT origin=CAST typeOperand=.IT @@ -40,14 +40,14 @@ FILE fqName: fileName:/inlineCollectionOfInlineClass.kt receiver: GET_VAR ': .IT declared in .IT.equals' type=.IT origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR 'val tmp_0: .IT [val] declared in .IT.equals' type=.IT origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IT' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .IT' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IT' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .IT' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.IT) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name: type:.IT + $this: VALUE_PARAMETER name: type:.IT BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .IT' CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null @@ -56,7 +56,7 @@ FILE fqName: fileName:/inlineCollectionOfInlineClass.kt FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.IT) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name: type:.IT + $this: VALUE_PARAMETER name: type:.IT BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .IT' STRING_CONCATENATION type=kotlin.String @@ -198,17 +198,17 @@ FILE fqName: fileName:/inlineCollectionOfInlineClass.kt $this: CALL 'private final fun (): kotlin.collections.MutableSet<.IT> declared in .InlineMutableSet' type=kotlin.collections.MutableSet<.IT> origin=GET_PROPERTY $this: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.retainAll' type=.InlineMutableSet origin=null elements: GET_VAR 'elements: kotlin.collections.Collection<.IT> declared in .InlineMutableSet.retainAll' type=kotlin.collections.Collection<.IT> origin=null - FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.InlineMutableSet, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.InlineMutableSet, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name: type:.InlineMutableSet - VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.InlineMutableSet + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.InlineMutableSet GET_VAR 'other: kotlin.Any? declared in .InlineMutableSet.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .InlineMutableSet' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .InlineMutableSet' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:.InlineMutableSet [val] TYPE_OP type=.InlineMutableSet origin=CAST typeOperand=.InlineMutableSet @@ -221,14 +221,14 @@ FILE fqName: fileName:/inlineCollectionOfInlineClass.kt receiver: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.equals' type=.InlineMutableSet origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ms type:kotlin.collections.MutableSet<.IT> visibility:private [final]' type=kotlin.collections.MutableSet<.IT> origin=null receiver: GET_VAR 'val tmp_1: .InlineMutableSet [val] declared in .InlineMutableSet.equals' type=.InlineMutableSet origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .InlineMutableSet' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .InlineMutableSet' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .InlineMutableSet' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .InlineMutableSet' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.InlineMutableSet) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name: type:.InlineMutableSet + $this: VALUE_PARAMETER name: type:.InlineMutableSet BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .InlineMutableSet' CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.collections.MutableSet' type=kotlin.Int origin=null @@ -237,7 +237,7 @@ FILE fqName: fileName:/inlineCollectionOfInlineClass.kt FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.InlineMutableSet) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name: type:.InlineMutableSet + $this: VALUE_PARAMETER name: type:.InlineMutableSet BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .InlineMutableSet' STRING_CONCATENATION type=kotlin.String diff --git a/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.fir.kt.txt b/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.fir.kt.txt index 4be294179ba..23d8ea8f7d6 100644 --- a/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.fir.kt.txt @@ -9,7 +9,7 @@ value class IT { field = x get - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { other !is IT -> return false } @@ -86,7 +86,7 @@ value class InlineMutableSet : MutableSet { return .().retainAll(elements = elements) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { other !is InlineMutableSet -> return false } diff --git a/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.fir.ir.txt b/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.fir.ir.txt index fbc115e673c..e4c4cbb46fe 100644 --- a/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.fir.ir.txt @@ -35,24 +35,24 @@ FILE fqName: fileName:/dataClassWithJvmRecord.kt RETURN type=kotlin.Nothing from='public final fun copy (name: kotlin.String): .MyRec declared in .MyRec' CONSTRUCTOR_CALL 'public constructor (name: kotlin.String) [primary] declared in .MyRec' type=.MyRec origin=null name: GET_VAR 'name: kotlin.String declared in .MyRec.copy' type=kotlin.String origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.MyRec, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.MyRec, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.MyRec - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.MyRec + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .MyRec declared in .MyRec.equals' type=.MyRec origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .MyRec.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyRec' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .MyRec' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.MyRec GET_VAR 'other: kotlin.Any? declared in .MyRec.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyRec' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .MyRec' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.MyRec [val] TYPE_OP type=.MyRec origin=CAST typeOperand=.MyRec @@ -65,14 +65,14 @@ FILE fqName: fileName:/dataClassWithJvmRecord.kt receiver: GET_VAR ': .MyRec declared in .MyRec.equals' type=.MyRec origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR 'val tmp_0: .MyRec [val] declared in .MyRec.equals' type=.MyRec origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyRec' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .MyRec' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyRec' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .MyRec' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.MyRec) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.MyRec + $this: VALUE_PARAMETER name: type:.MyRec BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .MyRec' CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.String' type=kotlin.Int origin=null @@ -81,7 +81,7 @@ FILE fqName: fileName:/dataClassWithJvmRecord.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.MyRec) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.MyRec + $this: VALUE_PARAMETER name: type:.MyRec BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .MyRec' STRING_CONCATENATION type=kotlin.String diff --git a/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.fir.kt.txt b/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.fir.kt.txt index 5abe36b5118..f264bbb25e7 100644 --- a/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/jvmRecord/dataClassWithJvmRecord.fir.kt.txt @@ -18,7 +18,7 @@ data class MyRec : Record { return MyRec(name = name) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } diff --git a/compiler/testData/ir/irText/declarations/kt52677.fir.ir.txt b/compiler/testData/ir/irText/declarations/kt52677.fir.ir.txt index 3535b0a19dd..311cb909e28 100644 --- a/compiler/testData/ir/irText/declarations/kt52677.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/kt52677.fir.ir.txt @@ -67,24 +67,24 @@ FILE fqName: fileName:/kt52677.kt RETURN type=kotlin.Nothing from='public final fun copy (id: @[MySerializable(c = ...)] .Uuid1): .LoginSuccessPacket declared in .LoginSuccessPacket' CONSTRUCTOR_CALL 'public constructor (id: @[MySerializable(c = ...)] .Uuid1) [primary] declared in .LoginSuccessPacket' type=.LoginSuccessPacket origin=null id: GET_VAR 'id: @[MySerializable(c = ...)] .Uuid1 declared in .LoginSuccessPacket.copy' type=@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.LoginSuccessPacket, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.LoginSuccessPacket, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.LoginSuccessPacket - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.LoginSuccessPacket + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .LoginSuccessPacket declared in .LoginSuccessPacket.equals' type=.LoginSuccessPacket origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .LoginSuccessPacket.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .LoginSuccessPacket' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .LoginSuccessPacket' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.LoginSuccessPacket GET_VAR 'other: kotlin.Any? declared in .LoginSuccessPacket.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .LoginSuccessPacket' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .LoginSuccessPacket' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.LoginSuccessPacket [val] TYPE_OP type=.LoginSuccessPacket origin=CAST typeOperand=.LoginSuccessPacket @@ -97,14 +97,14 @@ FILE fqName: fileName:/kt52677.kt receiver: GET_VAR ': .LoginSuccessPacket declared in .LoginSuccessPacket.equals' type=.LoginSuccessPacket origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:id type:@[MySerializable(c = ...)] .Uuid1 visibility:private [final]' type=@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 origin=null receiver: GET_VAR 'val tmp_0: .LoginSuccessPacket [val] declared in .LoginSuccessPacket.equals' type=.LoginSuccessPacket origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .LoginSuccessPacket' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .LoginSuccessPacket' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .LoginSuccessPacket' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .LoginSuccessPacket' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.LoginSuccessPacket) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.LoginSuccessPacket + $this: VALUE_PARAMETER name: type:.LoginSuccessPacket BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .LoginSuccessPacket' CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null @@ -113,7 +113,7 @@ FILE fqName: fileName:/kt52677.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.LoginSuccessPacket) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.LoginSuccessPacket + $this: VALUE_PARAMETER name: type:.LoginSuccessPacket BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .LoginSuccessPacket' STRING_CONCATENATION type=kotlin.String diff --git a/compiler/testData/ir/irText/declarations/kt52677.fir.kt.txt b/compiler/testData/ir/irText/declarations/kt52677.fir.kt.txt index e1b15331f39..56999cc67f6 100644 --- a/compiler/testData/ir/irText/declarations/kt52677.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/kt52677.fir.kt.txt @@ -32,7 +32,7 @@ data class LoginSuccessPacket { return LoginSuccessPacket(id = id) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } diff --git a/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.fir.ir.txt b/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.fir.ir.txt index 38ef438665b..7acbc0c4b8f 100644 --- a/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.fir.ir.txt @@ -60,24 +60,24 @@ FILE fqName: fileName:/dataClassMembers.kt : kotlin.Any x: GET_VAR 'x: T of .Test declared in .Test.copy' type=T of .Test origin=null y: GET_VAR 'y: kotlin.String declared in .Test.copy' type=kotlin.String origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test.Test>, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test.Test>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test.Test> - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.Test.Test> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .Test.Test> declared in .Test.equals' type=.Test.Test> origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .Test.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.Test.Test> GET_VAR 'other: kotlin.Any? declared in .Test.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.Test.Test> [val] TYPE_OP type=.Test.Test> origin=CAST typeOperand=.Test.Test> @@ -90,7 +90,7 @@ FILE fqName: fileName:/dataClassMembers.kt receiver: GET_VAR ': .Test.Test> declared in .Test.equals' type=.Test.Test> origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test visibility:private [final]' type=T of .Test origin=null receiver: GET_VAR 'val tmp_0: .Test.Test> [val] declared in .Test.equals' type=.Test.Test> origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test' CONST Boolean type=kotlin.Boolean value=false WHEN type=kotlin.Unit origin=null BRANCH @@ -100,14 +100,14 @@ FILE fqName: fileName:/dataClassMembers.kt receiver: GET_VAR ': .Test.Test> declared in .Test.equals' type=.Test.Test> origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR 'val tmp_0: .Test.Test> [val] declared in .Test.equals' type=.Test.Test> origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Test' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test.Test>) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test.Test> + $this: VALUE_PARAMETER name: type:.Test.Test> BLOCK_BODY VAR name:result type:kotlin.Int [var] WHEN type=kotlin.Int origin=null @@ -135,7 +135,7 @@ FILE fqName: fileName:/dataClassMembers.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test.Test>) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test.Test> + $this: VALUE_PARAMETER name: type:.Test.Test> BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test' STRING_CONCATENATION type=kotlin.String diff --git a/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.fir.kt.txt b/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.fir.kt.txt index eecc6bc846f..d82d037ae6a 100644 --- a/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.fir.kt.txt @@ -25,7 +25,7 @@ data class Test { return Test(x = x, y = y) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } diff --git a/compiler/testData/ir/irText/firProblems/ArrayMap.fir.ir.txt b/compiler/testData/ir/irText/firProblems/ArrayMap.fir.ir.txt index fff514ce870..4ebd40f4b93 100644 --- a/compiler/testData/ir/irText/firProblems/ArrayMap.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/ArrayMap.fir.ir.txt @@ -745,24 +745,24 @@ FILE fqName: fileName:/ArrayMap.kt : kotlin.Any key: GET_VAR 'key: kotlin.Int declared in .ArrayMapImpl.Entry.copy' type=kotlin.Int origin=null value: GET_VAR 'value: T of .ArrayMapImpl.Entry declared in .ArrayMapImpl.Entry.copy' type=T of .ArrayMapImpl.Entry origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.equals' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .ArrayMapImpl.Entry.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ArrayMapImpl.Entry' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .ArrayMapImpl.Entry' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> GET_VAR 'other: kotlin.Any? declared in .ArrayMapImpl.Entry.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ArrayMapImpl.Entry' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .ArrayMapImpl.Entry' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> [val] TYPE_OP type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=CAST typeOperand=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> @@ -775,7 +775,7 @@ FILE fqName: fileName:/ArrayMap.kt receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.equals' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:key type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR 'val tmp_3: .ArrayMapImpl.Entry.ArrayMapImpl.Entry> [val] declared in .ArrayMapImpl.Entry.equals' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ArrayMapImpl.Entry' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .ArrayMapImpl.Entry' CONST Boolean type=kotlin.Boolean value=false WHEN type=kotlin.Unit origin=null BRANCH @@ -785,14 +785,14 @@ FILE fqName: fileName:/ArrayMap.kt receiver: GET_VAR ': .ArrayMapImpl.Entry.ArrayMapImpl.Entry> declared in .ArrayMapImpl.Entry.equals' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .ArrayMapImpl.Entry visibility:private [final]' type=T of .ArrayMapImpl.Entry origin=null receiver: GET_VAR 'val tmp_3: .ArrayMapImpl.Entry.ArrayMapImpl.Entry> [val] declared in .ArrayMapImpl.Entry.equals' type=.ArrayMapImpl.Entry.ArrayMapImpl.Entry> origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ArrayMapImpl.Entry' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .ArrayMapImpl.Entry' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .ArrayMapImpl.Entry' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .ArrayMapImpl.Entry' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> + $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> BLOCK_BODY VAR name:result type:kotlin.Int [var] CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null @@ -820,7 +820,7 @@ FILE fqName: fileName:/ArrayMap.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.ArrayMapImpl.Entry.ArrayMapImpl.Entry>) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> + $this: VALUE_PARAMETER name: type:.ArrayMapImpl.Entry.ArrayMapImpl.Entry> BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .ArrayMapImpl.Entry' STRING_CONCATENATION type=kotlin.String diff --git a/compiler/testData/ir/irText/firProblems/ArrayMap.fir.kt.txt b/compiler/testData/ir/irText/firProblems/ArrayMap.fir.kt.txt index 61fa33bc1c2..bafc8202fab 100644 --- a/compiler/testData/ir/irText/firProblems/ArrayMap.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/ArrayMap.fir.kt.txt @@ -295,7 +295,7 @@ internal class ArrayMapImpl : ArrayMap { return Entry(key = key, value = value) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } diff --git a/compiler/testData/ir/irText/firProblems/MultiList.fir.ir.txt b/compiler/testData/ir/irText/firProblems/MultiList.fir.ir.txt index 46e68cfa75f..05177aa9bb7 100644 --- a/compiler/testData/ir/irText/firProblems/MultiList.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/MultiList.fir.ir.txt @@ -35,24 +35,24 @@ FILE fqName: fileName:/MultiList.kt CONSTRUCTOR_CALL 'public constructor (value: T of .Some) [primary] declared in .Some' type=.Some.Some> origin=null : kotlin.Any value: GET_VAR 'value: T of .Some declared in .Some.copy' type=T of .Some origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Some.Some>, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Some.Some>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Some.Some> - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.Some.Some> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .Some.Some> declared in .Some.equals' type=.Some.Some> origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .Some.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Some' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Some' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.Some.Some> GET_VAR 'other: kotlin.Any? declared in .Some.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Some' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Some' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.Some.Some> [val] TYPE_OP type=.Some.Some> origin=CAST typeOperand=.Some.Some> @@ -65,14 +65,14 @@ FILE fqName: fileName:/MultiList.kt receiver: GET_VAR ': .Some.Some> declared in .Some.equals' type=.Some.Some> origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Some visibility:private [final]' type=T of .Some origin=null receiver: GET_VAR 'val tmp_0: .Some.Some> [val] declared in .Some.equals' type=.Some.Some> origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Some' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Some' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Some' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Some' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Some.Some>) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Some.Some> + $this: VALUE_PARAMETER name: type:.Some.Some> BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Some' WHEN type=kotlin.Int origin=null @@ -90,7 +90,7 @@ FILE fqName: fileName:/MultiList.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Some.Some>) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Some.Some> + $this: VALUE_PARAMETER name: type:.Some.Some> BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Some' STRING_CONCATENATION type=kotlin.String diff --git a/compiler/testData/ir/irText/firProblems/MultiList.fir.kt.txt b/compiler/testData/ir/irText/firProblems/MultiList.fir.kt.txt index 86418c2ccfc..1b76c1ca2a8 100644 --- a/compiler/testData/ir/irText/firProblems/MultiList.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/MultiList.fir.kt.txt @@ -17,7 +17,7 @@ data class Some { return Some(value = value) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } diff --git a/compiler/testData/ir/irText/firProblems/SignatureClash.fir.ir.txt b/compiler/testData/ir/irText/firProblems/SignatureClash.fir.ir.txt index 5251566f1c2..acc18dec7d7 100644 --- a/compiler/testData/ir/irText/firProblems/SignatureClash.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/SignatureClash.fir.ir.txt @@ -126,24 +126,24 @@ FILE fqName: fileName:/SignatureClash.kt RETURN type=kotlin.Nothing from='public final fun copy (delegate: .Delegate): .DataClass declared in .DataClass' CONSTRUCTOR_CALL 'public constructor (delegate: .Delegate) [primary] declared in .DataClass' type=.DataClass origin=null delegate: GET_VAR 'delegate: .Delegate declared in .DataClass.copy' type=.Delegate origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.DataClass, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.DataClass, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.DataClass - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.DataClass + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .DataClass declared in .DataClass.equals' type=.DataClass origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .DataClass.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .DataClass' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .DataClass' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.DataClass GET_VAR 'other: kotlin.Any? declared in .DataClass.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .DataClass' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .DataClass' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.DataClass [val] TYPE_OP type=.DataClass origin=CAST typeOperand=.DataClass @@ -156,14 +156,14 @@ FILE fqName: fileName:/SignatureClash.kt receiver: GET_VAR ': .DataClass declared in .DataClass.equals' type=.DataClass origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:delegate type:.Delegate visibility:private [final]' type=.Delegate origin=null receiver: GET_VAR 'val tmp_0: .DataClass [val] declared in .DataClass.equals' type=.DataClass origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .DataClass' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .DataClass' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .DataClass' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .DataClass' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.DataClass) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.DataClass + $this: VALUE_PARAMETER name: type:.DataClass BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .DataClass' CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in .Delegate' type=kotlin.Int origin=null @@ -172,7 +172,7 @@ FILE fqName: fileName:/SignatureClash.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.DataClass) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.DataClass + $this: VALUE_PARAMETER name: type:.DataClass BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .DataClass' STRING_CONCATENATION type=kotlin.String diff --git a/compiler/testData/ir/irText/firProblems/SignatureClash.fir.kt.txt b/compiler/testData/ir/irText/firProblems/SignatureClash.fir.kt.txt index ffc773c9e45..7c962bdc230 100644 --- a/compiler/testData/ir/irText/firProblems/SignatureClash.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/SignatureClash.fir.kt.txt @@ -52,7 +52,7 @@ data class DataClass : Derived, Delegate { return DataClass(delegate = delegate) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } diff --git a/compiler/testData/ir/irText/firProblems/dataObject.fir.ir.txt b/compiler/testData/ir/irText/firProblems/dataObject.fir.ir.txt index dfb8e9f9ac7..18fda30f454 100644 --- a/compiler/testData/ir/irText/firProblems/dataObject.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/dataObject.fir.ir.txt @@ -5,41 +5,41 @@ FILE fqName: fileName:/dataObject.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:DataObject modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.DataObject, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.DataObject, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.DataObject - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.DataObject + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .DataObject declared in .DataObject.equals' type=.DataObject origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .DataObject.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .DataObject' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .DataObject' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.DataObject GET_VAR 'other: kotlin.Any? declared in .DataObject.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .DataObject' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .DataObject' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.DataObject [val] TYPE_OP type=.DataObject origin=CAST typeOperand=.DataObject GET_VAR 'other: kotlin.Any? declared in .DataObject.equals' type=kotlin.Any? origin=null - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .DataObject' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .DataObject' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.DataObject) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.DataObject + $this: VALUE_PARAMETER name: type:.DataObject BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .DataObject' CONST Int type=kotlin.Int value=-1155894359 FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.DataObject) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.DataObject + $this: VALUE_PARAMETER name: type:.DataObject BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .DataObject' CONST String type=kotlin.String value="DataObject" diff --git a/compiler/testData/ir/irText/firProblems/dataObject.fir.kt.txt b/compiler/testData/ir/irText/firProblems/dataObject.fir.kt.txt index 6510ed17a67..72ea1dcf206 100644 --- a/compiler/testData/ir/irText/firProblems/dataObject.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/dataObject.fir.kt.txt @@ -5,7 +5,7 @@ data object DataObject { } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } diff --git a/compiler/testData/ir/irText/firProblems/valueClassEquals.fir.ir.txt b/compiler/testData/ir/irText/firProblems/valueClassEquals.fir.ir.txt index bcfeb8a1ca2..3a8bc95487c 100644 --- a/compiler/testData/ir/irText/firProblems/valueClassEquals.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/valueClassEquals.fir.ir.txt @@ -19,17 +19,17 @@ FILE fqName: fileName:/valueClassEquals.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Z' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .Z declared in .Z.' type=.Z origin=null - FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Z, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Z, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name: type:.Z - VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.Z + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.Z GET_VAR 'other: kotlin.Any? declared in .Z.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Z' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Z' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.Z [val] TYPE_OP type=.Z origin=CAST typeOperand=.Z @@ -42,14 +42,14 @@ FILE fqName: fileName:/valueClassEquals.kt receiver: GET_VAR ': .Z declared in .Z.equals' type=.Z origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR 'val tmp_0: .Z [val] declared in .Z.equals' type=.Z origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Z' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Z' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Z' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Z' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Z) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name: type:.Z + $this: VALUE_PARAMETER name: type:.Z BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Z' CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.String' type=kotlin.Int origin=null @@ -58,7 +58,7 @@ FILE fqName: fileName:/valueClassEquals.kt FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Z) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name: type:.Z + $this: VALUE_PARAMETER name: type:.Z BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Z' STRING_CONCATENATION type=kotlin.String diff --git a/compiler/testData/ir/irText/firProblems/valueClassEquals.fir.kt.txt b/compiler/testData/ir/irText/firProblems/valueClassEquals.fir.kt.txt index 1f91b469a53..4224114cef2 100644 --- a/compiler/testData/ir/irText/firProblems/valueClassEquals.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/valueClassEquals.fir.kt.txt @@ -10,7 +10,7 @@ value class Z { field = s get - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { other !is Z -> return false } diff --git a/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.ir.txt b/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.ir.txt index 83d304d42a0..868faa79784 100644 --- a/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.ir.txt +++ b/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.ir.txt @@ -56,24 +56,24 @@ FILE fqName: fileName:/destructuringInLambda.kt CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int, y: kotlin.Int) [primary] declared in .A' type=.A origin=null x: GET_VAR 'x: kotlin.Int declared in .A.copy' type=kotlin.Int origin=null y: GET_VAR 'y: kotlin.Int declared in .A.copy' type=kotlin.Int origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.A, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.A, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.A - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.A + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .A declared in .A.equals' type=.A origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .A.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .A' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.A GET_VAR 'other: kotlin.Any? declared in .A.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .A' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.A [val] TYPE_OP type=.A origin=CAST typeOperand=.A @@ -86,7 +86,7 @@ FILE fqName: fileName:/destructuringInLambda.kt receiver: GET_VAR ': .A declared in .A.equals' type=.A origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR 'val tmp_0: .A [val] declared in .A.equals' type=.A origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .A' CONST Boolean type=kotlin.Boolean value=false WHEN type=kotlin.Unit origin=null BRANCH @@ -96,14 +96,14 @@ FILE fqName: fileName:/destructuringInLambda.kt receiver: GET_VAR ': .A declared in .A.equals' type=.A origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR 'val tmp_0: .A [val] declared in .A.equals' type=.A origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .A' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .A' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.A + $this: VALUE_PARAMETER name: type:.A BLOCK_BODY VAR name:result type:kotlin.Int [var] CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null @@ -122,7 +122,7 @@ FILE fqName: fileName:/destructuringInLambda.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.A + $this: VALUE_PARAMETER name: type:.A BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .A' STRING_CONCATENATION type=kotlin.String diff --git a/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.kt.txt b/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.kt.txt index e9195d28e4b..a2b582f8324 100644 --- a/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.kt.txt +++ b/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.kt.txt @@ -25,7 +25,7 @@ data class A { return A(x = x, y = y) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } diff --git a/compiler/testData/ir/irText/regressions/kt45236.fir.ir.txt b/compiler/testData/ir/irText/regressions/kt45236.fir.ir.txt index b8c08db712d..431a04ad5fe 100644 --- a/compiler/testData/ir/irText/regressions/kt45236.fir.ir.txt +++ b/compiler/testData/ir/irText/regressions/kt45236.fir.ir.txt @@ -78,24 +78,24 @@ FILE fqName: fileName:/kt45236.kt : kotlin.Any error: GET_VAR 'error: kotlin.Throwable declared in .NetRequestStatus.Error.copy' type=kotlin.Throwable origin=null value: GET_VAR 'value: T of .NetRequestStatus.Error? declared in .NetRequestStatus.Error.copy' type=T of .NetRequestStatus.Error? origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.NetRequestStatus.Error.NetRequestStatus.Error>, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.NetRequestStatus.Error.NetRequestStatus.Error>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.NetRequestStatus.Error.NetRequestStatus.Error> - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.NetRequestStatus.Error.NetRequestStatus.Error> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .NetRequestStatus.Error.NetRequestStatus.Error> declared in .NetRequestStatus.Error.equals' type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .NetRequestStatus.Error.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .NetRequestStatus.Error' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .NetRequestStatus.Error' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.NetRequestStatus.Error.NetRequestStatus.Error> GET_VAR 'other: kotlin.Any? declared in .NetRequestStatus.Error.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .NetRequestStatus.Error' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .NetRequestStatus.Error' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.NetRequestStatus.Error.NetRequestStatus.Error> [val] TYPE_OP type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=CAST typeOperand=.NetRequestStatus.Error.NetRequestStatus.Error> @@ -108,7 +108,7 @@ FILE fqName: fileName:/kt45236.kt receiver: GET_VAR ': .NetRequestStatus.Error.NetRequestStatus.Error> declared in .NetRequestStatus.Error.equals' type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:error type:kotlin.Throwable visibility:private [final]' type=kotlin.Throwable origin=null receiver: GET_VAR 'val tmp_0: .NetRequestStatus.Error.NetRequestStatus.Error> [val] declared in .NetRequestStatus.Error.equals' type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .NetRequestStatus.Error' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .NetRequestStatus.Error' CONST Boolean type=kotlin.Boolean value=false WHEN type=kotlin.Unit origin=null BRANCH @@ -118,14 +118,14 @@ FILE fqName: fileName:/kt45236.kt receiver: GET_VAR ': .NetRequestStatus.Error.NetRequestStatus.Error> declared in .NetRequestStatus.Error.equals' type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .NetRequestStatus.Error? visibility:private [final]' type=T of .NetRequestStatus.Error? origin=null receiver: GET_VAR 'val tmp_0: .NetRequestStatus.Error.NetRequestStatus.Error> [val] declared in .NetRequestStatus.Error.equals' type=.NetRequestStatus.Error.NetRequestStatus.Error> origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .NetRequestStatus.Error' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .NetRequestStatus.Error' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .NetRequestStatus.Error' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .NetRequestStatus.Error' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.NetRequestStatus.Error.NetRequestStatus.Error>) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.NetRequestStatus.Error.NetRequestStatus.Error> + $this: VALUE_PARAMETER name: type:.NetRequestStatus.Error.NetRequestStatus.Error> BLOCK_BODY VAR name:result type:kotlin.Int [var] CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Throwable' type=kotlin.Int origin=null @@ -153,7 +153,7 @@ FILE fqName: fileName:/kt45236.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.NetRequestStatus.Error.NetRequestStatus.Error>) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.NetRequestStatus.Error.NetRequestStatus.Error> + $this: VALUE_PARAMETER name: type:.NetRequestStatus.Error.NetRequestStatus.Error> BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .NetRequestStatus.Error' STRING_CONCATENATION type=kotlin.String diff --git a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.ir.txt b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.ir.txt index bf5e085709d..663400dc9cb 100644 --- a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.ir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.ir.txt @@ -182,24 +182,24 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int, y: kotlin.Int) [primary] declared in .P' type=.P origin=null x: GET_VAR 'x: kotlin.Int declared in .P.copy' type=kotlin.Int origin=null y: GET_VAR 'y: kotlin.Int declared in .P.copy' type=kotlin.Int origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.P, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.P, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.P - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.P + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .P declared in .P.equals' type=.P origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .P.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .P' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .P' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.P GET_VAR 'other: kotlin.Any? declared in .P.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .P' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .P' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:.P [val] TYPE_OP type=.P origin=CAST typeOperand=.P @@ -212,7 +212,7 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt receiver: GET_VAR ': .P declared in .P.equals' type=.P origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR 'val tmp_6: .P [val] declared in .P.equals' type=.P origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .P' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .P' CONST Boolean type=kotlin.Boolean value=false WHEN type=kotlin.Unit origin=null BRANCH @@ -222,14 +222,14 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt receiver: GET_VAR ': .P declared in .P.equals' type=.P origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR 'val tmp_6: .P [val] declared in .P.equals' type=.P origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .P' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .P' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .P' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .P' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.P) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.P + $this: VALUE_PARAMETER name: type:.P BLOCK_BODY VAR name:result type:kotlin.Int [var] CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null @@ -248,7 +248,7 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.P) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.P + $this: VALUE_PARAMETER name: type:.P BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .P' STRING_CONCATENATION type=kotlin.String diff --git a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.kt.txt b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.kt.txt index 62dec72a4ca..a18fa637057 100644 --- a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.kt.txt +++ b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.kt.txt @@ -101,7 +101,7 @@ data class P { return P(x = x, y = y) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true } diff --git a/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.fir.ir.txt b/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.fir.ir.txt index 9431116e3e0..dcfc355a4e9 100644 --- a/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.fir.ir.txt +++ b/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.fir.ir.txt @@ -37,24 +37,24 @@ FILE fqName: fileName:/typeAliasWithUnsafeVariance.kt CONSTRUCTOR_CALL 'public constructor (action: kotlin.Function1.Tag, kotlin.Unit>) [primary] declared in .Tag' type=.Tag.Tag> origin=null : kotlin.Any action: GET_VAR 'action: kotlin.Function1.Tag, kotlin.Unit> declared in .Tag.copy' type=kotlin.Function1.Tag, kotlin.Unit> origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Tag.Tag>, other:kotlin.Any?) returnType:kotlin.Boolean + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Tag.Tag>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Tag.Tag> - VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any? + $this: VALUE_PARAMETER name: type:.Tag.Tag> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY WHEN type=kotlin.Unit origin=null BRANCH if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ arg0: GET_VAR ': .Tag.Tag> declared in .Tag.equals' type=.Tag.Tag> origin=null arg1: GET_VAR 'other: kotlin.Any? declared in .Tag.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Tag' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Tag' CONST Boolean type=kotlin.Boolean value=true WHEN type=kotlin.Unit origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.Tag.Tag> GET_VAR 'other: kotlin.Any? declared in .Tag.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Tag' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Tag' CONST Boolean type=kotlin.Boolean value=false VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.Tag.Tag> [val] TYPE_OP type=.Tag.Tag> origin=CAST typeOperand=.Tag.Tag> @@ -67,14 +67,14 @@ FILE fqName: fileName:/typeAliasWithUnsafeVariance.kt receiver: GET_VAR ': .Tag.Tag> declared in .Tag.equals' type=.Tag.Tag> origin=null arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:action type:kotlin.Function1.Tag, kotlin.Unit> visibility:private [final]' type=kotlin.Function1.Tag, kotlin.Unit> origin=null receiver: GET_VAR 'val tmp_0: .Tag.Tag> [val] declared in .Tag.equals' type=.Tag.Tag> origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Tag' + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Tag' CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Tag' + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Tag' CONST Boolean type=kotlin.Boolean value=true FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Tag.Tag>) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Tag.Tag> + $this: VALUE_PARAMETER name: type:.Tag.Tag> BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Tag' CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Function1' type=kotlin.Int origin=null @@ -83,7 +83,7 @@ FILE fqName: fileName:/typeAliasWithUnsafeVariance.kt FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Tag.Tag>) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Tag.Tag> + $this: VALUE_PARAMETER name: type:.Tag.Tag> BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Tag' STRING_CONCATENATION type=kotlin.String diff --git a/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.fir.kt.txt b/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.fir.kt.txt index a80d2ab0cf4..540e29dfc3b 100644 --- a/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.fir.kt.txt +++ b/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.fir.kt.txt @@ -18,7 +18,7 @@ data class Tag { return Tag(action = action) } - override fun equals(other: Any?): Boolean { + override operator fun equals(other: Any?): Boolean { when { EQEQEQ(arg0 = , arg1 = other) -> return true }