diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DataClassMembersGenerator.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DataClassMembersGenerator.kt index ab46b792271..850593758cb 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DataClassMembersGenerator.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DataClassMembersGenerator.kt @@ -12,6 +12,8 @@ import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET import org.jetbrains.kotlin.ir.builders.* import org.jetbrains.kotlin.ir.declarations.* +import org.jetbrains.kotlin.ir.declarations.impl.IrVariableImpl +import org.jetbrains.kotlin.ir.descriptors.WrappedVariableDescriptor import org.jetbrains.kotlin.ir.expressions.IrExpression import org.jetbrains.kotlin.ir.expressions.IrMemberAccessExpression import org.jetbrains.kotlin.ir.expressions.impl.IrGetValueImpl @@ -19,6 +21,7 @@ import org.jetbrains.kotlin.ir.expressions.mapTypeParameters import org.jetbrains.kotlin.ir.expressions.mapValueParameters import org.jetbrains.kotlin.ir.symbols.IrConstructorSymbol import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol +import org.jetbrains.kotlin.ir.symbols.impl.IrVariableSymbolImpl import org.jetbrains.kotlin.ir.types.IrType import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.resolve.scopes.MemberScope @@ -139,18 +142,37 @@ abstract class DataClassMembersGenerator( }.let { symbolTable.referenceSimpleFunction(it) } fun generateHashCodeMethodBody(properties: List) { - val irIntType = context.irBuiltIns.intType - var result: IrExpression? = null - for (property in properties) { - val hashCodeOfProperty = getHashCodeOfProperty(property) - result = if (result == null) { - hashCodeOfProperty - } else { - val shiftedResult = irCallOp(intTimesSymbol, irIntType, result, irInt(31)) - irCallOp(intPlusSymbol, irIntType, shiftedResult, hashCodeOfProperty) - } + if (properties.isEmpty()) { + +irReturn(irInt(0)) + return + } else if (properties.size == 1) { + +irReturn(getHashCodeOfProperty(properties[0])) + return } - +irReturn(result ?: irInt(0)) + + val irIntType = context.irBuiltIns.intType + + val resultVarDescriptor = WrappedVariableDescriptor() + val irResultVar = IrVariableImpl( + startOffset, endOffset, + IrDeclarationOrigin.DEFINED, + IrVariableSymbolImpl(resultVarDescriptor), + Name.identifier("result"), irIntType, + isVar = true, isConst = false, isLateinit = false + ).also { + resultVarDescriptor.bind(it) + it.parent = irFunction + it.initializer = getHashCodeOfProperty(properties[0]) + } + +irResultVar + + for (property in properties.drop(1)) { + val shiftedResult = irCallOp(intTimesSymbol, irIntType, irGet(irResultVar), irInt(31)) + val irRhs = irCallOp(intPlusSymbol, irIntType, shiftedResult, getHashCodeOfProperty(property)) + +irSetVar(irResultVar.symbol, irRhs) + } + + +irReturn(irGet(irResultVar)) } private fun getHashCodeOfProperty(property: PropertyDescriptor): IrExpression { diff --git a/compiler/testData/ir/irText/classes/dataClassWithArrayMembers.fir.txt b/compiler/testData/ir/irText/classes/dataClassWithArrayMembers.fir.txt index 3d9952d2154..29be395b658 100644 --- a/compiler/testData/ir/irText/classes/dataClassWithArrayMembers.fir.txt +++ b/compiler/testData/ir/irText/classes/dataClassWithArrayMembers.fir.txt @@ -336,58 +336,76 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt public open fun hashCode (): kotlin.Int declared in kotlin.Any $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test1 BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test1' + 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 + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:stringArray type:kotlin.Array visibility:private [final]' type=kotlin.Array origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Unit origin=EQ CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:stringArray type:kotlin.Array visibility:private [final]' type=kotlin.Array origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:charArray type:kotlin.CharArray visibility:private [final]' type=kotlin.CharArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:booleanArray type:kotlin.BooleanArray visibility:private [final]' type=kotlin.BooleanArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:byteArray type:kotlin.ByteArray visibility:private [final]' type=kotlin.ByteArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:shortArray type:kotlin.ShortArray visibility:private [final]' type=kotlin.ShortArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:intArray type:kotlin.IntArray visibility:private [final]' type=kotlin.IntArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:longArray type:kotlin.LongArray visibility:private [final]' type=kotlin.LongArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:floatArray type:kotlin.FloatArray visibility:private [final]' type=kotlin.FloatArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:charArray type:kotlin.CharArray visibility:private [final]' type=kotlin.CharArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:booleanArray type:kotlin.BooleanArray visibility:private [final]' type=kotlin.BooleanArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:byteArray type:kotlin.ByteArray visibility:private [final]' type=kotlin.ByteArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:shortArray type:kotlin.ShortArray visibility:private [final]' type=kotlin.ShortArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:intArray type:kotlin.IntArray visibility:private [final]' type=kotlin.IntArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:longArray type:kotlin.LongArray visibility:private [final]' type=kotlin.LongArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:floatArray type:kotlin.FloatArray visibility:private [final]' type=kotlin.FloatArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value=31 other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:doubleArray type:kotlin.DoubleArray visibility:private [final]' type=kotlin.DoubleArray origin=null receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test1' + GET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Int origin=null 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 diff --git a/compiler/testData/ir/irText/classes/dataClassWithArrayMembers.txt b/compiler/testData/ir/irText/classes/dataClassWithArrayMembers.txt index 2fc8d542ece..58b8c98f251 100644 --- a/compiler/testData/ir/irText/classes/dataClassWithArrayMembers.txt +++ b/compiler/testData/ir/irText/classes/dataClassWithArrayMembers.txt @@ -275,58 +275,76 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt public open fun hashCode (): kotlin.Int declared in kotlin.Any $this: VALUE_PARAMETER name: type:.Test1 BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test1' + 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 + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:stringArray type:kotlin.Array visibility:private [final]' type=kotlin.Array origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Unit origin=EQ CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:stringArray type:kotlin.Array visibility:private [final]' type=kotlin.Array origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:charArray type:kotlin.CharArray visibility:private [final]' type=kotlin.CharArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:booleanArray type:kotlin.BooleanArray visibility:private [final]' type=kotlin.BooleanArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:byteArray type:kotlin.ByteArray visibility:private [final]' type=kotlin.ByteArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:shortArray type:kotlin.ShortArray visibility:private [final]' type=kotlin.ShortArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:intArray type:kotlin.IntArray visibility:private [final]' type=kotlin.IntArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:longArray type:kotlin.LongArray visibility:private [final]' type=kotlin.LongArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:floatArray type:kotlin.FloatArray visibility:private [final]' type=kotlin.FloatArray origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:charArray type:kotlin.CharArray visibility:private [final]' type=kotlin.CharArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:booleanArray type:kotlin.BooleanArray visibility:private [final]' type=kotlin.BooleanArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:byteArray type:kotlin.ByteArray visibility:private [final]' type=kotlin.ByteArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:shortArray type:kotlin.ShortArray visibility:private [final]' type=kotlin.ShortArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:intArray type:kotlin.IntArray visibility:private [final]' type=kotlin.IntArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:longArray type:kotlin.LongArray visibility:private [final]' type=kotlin.LongArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:floatArray type:kotlin.FloatArray visibility:private [final]' type=kotlin.FloatArray origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value=31 other: CALL 'public final fun dataClassArrayMemberHashCode (arg0: kotlin.Any): kotlin.Int declared in kotlin.internal.ir' type=kotlin.Int origin=null arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:doubleArray type:kotlin.DoubleArray visibility:private [final]' type=kotlin.DoubleArray origin=null receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test1' + GET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Int origin=null 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 diff --git a/compiler/testData/ir/irText/classes/dataClasses.fir.txt b/compiler/testData/ir/irText/classes/dataClasses.fir.txt index 43bad152efd..df172c33a01 100644 --- a/compiler/testData/ir/irText/classes/dataClasses.fir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses.fir.txt @@ -138,22 +138,28 @@ FILE fqName: fileName:/dataClasses.kt public open fun hashCode (): kotlin.Int declared in kotlin.Any $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test1 BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test1' + 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 + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Unit origin=EQ CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.String' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.String' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value=31 other: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test1' + GET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Int origin=null 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 @@ -444,33 +450,39 @@ FILE fqName: fileName:/dataClasses.kt public open fun hashCode (): kotlin.Int declared in kotlin.Any $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test3 BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test3' + 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 + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:d type:kotlin.Double visibility:private [final]' type=kotlin.Double origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .Test3.hashCode' type=kotlin.Unit origin=EQ CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Double' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:d type:kotlin.Double visibility:private [final]' type=kotlin.Double origin=null - receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null - other: CONST Int type=kotlin.Int value=31 - other: WHEN type=kotlin.Int origin=null - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:dn type:kotlin.Double? visibility:private [final]' type=kotlin.Double? origin=null - receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Double' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:dn type:kotlin.Double? visibility:private [final]' type=kotlin.Double? origin=null - receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Float' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:f type:kotlin.Float visibility:private [final]' type=kotlin.Float origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .Test3.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: WHEN type=kotlin.Int origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:dn type:kotlin.Double? visibility:private [final]' type=kotlin.Double? origin=null receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Double' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:dn type:kotlin.Double? visibility:private [final]' type=kotlin.Double? origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .Test3.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .Test3.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Float' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:f type:kotlin.Float visibility:private [final]' type=kotlin.Float origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .Test3.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .Test3.hashCode' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value=31 other: WHEN type=kotlin.Int origin=null BRANCH @@ -484,6 +496,8 @@ FILE fqName: fileName:/dataClasses.kt then: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Float' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:df type:kotlin.Float? visibility:private [final]' type=kotlin.Float? origin=null receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test3' + GET_VAR 'var result: kotlin.Int [var] declared in .Test3.hashCode' type=kotlin.Int origin=null 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 diff --git a/compiler/testData/ir/irText/classes/dataClasses.txt b/compiler/testData/ir/irText/classes/dataClasses.txt index 6f4b013904b..233e6cf2e8b 100644 --- a/compiler/testData/ir/irText/classes/dataClasses.txt +++ b/compiler/testData/ir/irText/classes/dataClasses.txt @@ -104,22 +104,28 @@ FILE fqName: fileName:/dataClasses.kt public open fun hashCode (): kotlin.Int declared in kotlin.Any $this: VALUE_PARAMETER name: type:.Test1 BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test1' + 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 + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Unit origin=EQ CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.String' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.String' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value=31 other: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test1' + GET_VAR 'var result: kotlin.Int [var] declared in .Test1.hashCode' type=kotlin.Int origin=null 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 @@ -404,33 +410,39 @@ FILE fqName: fileName:/dataClasses.kt public open fun hashCode (): kotlin.Int declared in kotlin.Any $this: VALUE_PARAMETER name: type:.Test3 BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test3' + 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 + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:d type:kotlin.Double visibility:private [final]' type=kotlin.Double origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .Test3.hashCode' type=kotlin.Unit origin=EQ CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Double' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:d type:kotlin.Double visibility:private [final]' type=kotlin.Double origin=null - receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null - other: CONST Int type=kotlin.Int value=31 - other: WHEN type=kotlin.Int origin=null - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:dn type:kotlin.Double? visibility:private [final]' type=kotlin.Double? origin=null - receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Double' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:dn type:kotlin.Double? visibility:private [final]' type=kotlin.Double? origin=null - receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null - other: CONST Int type=kotlin.Int value=31 - other: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Float' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:f type:kotlin.Float visibility:private [final]' type=kotlin.Float origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .Test3.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: WHEN type=kotlin.Int origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:dn type:kotlin.Double? visibility:private [final]' type=kotlin.Double? origin=null receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Double' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:dn type:kotlin.Double? visibility:private [final]' type=kotlin.Double? origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .Test3.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .Test3.hashCode' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=31 + other: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Float' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:f type:kotlin.Float visibility:private [final]' type=kotlin.Float origin=null + receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .Test3.hashCode' type=kotlin.Unit origin=EQ + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .Test3.hashCode' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value=31 other: WHEN type=kotlin.Int origin=null BRANCH @@ -444,6 +456,8 @@ FILE fqName: fileName:/dataClasses.kt then: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Float' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:df type:kotlin.Float? visibility:private [final]' type=kotlin.Float? origin=null receiver: GET_VAR ': .Test3 declared in .Test3.hashCode' type=.Test3 origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test3' + GET_VAR 'var result: kotlin.Int [var] declared in .Test3.hashCode' type=kotlin.Int origin=null 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 diff --git a/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.fir.txt b/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.fir.txt index 1e5f5aeb099..edd9a6f028b 100644 --- a/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.fir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.fir.txt @@ -109,25 +109,29 @@ FILE fqName: fileName:/dataClassMembers.kt public open fun hashCode (): kotlin.Int declared in kotlin.Any $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test.Test> BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test' + VAR name:result type:kotlin.Int [var] + WHEN type=kotlin.Int origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test visibility:private [final]' type=T of .Test origin=null + receiver: GET_VAR ': .Test.Test> declared in .Test.hashCode' type=.Test.Test> origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test visibility:private [final]' type=T of .Test origin=null + receiver: GET_VAR ': .Test.Test> declared in .Test.hashCode' type=.Test.Test> origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .Test.hashCode' type=kotlin.Unit origin=EQ CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: WHEN type=kotlin.Int origin=null - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test visibility:private [final]' type=T of .Test origin=null - receiver: GET_VAR ': .Test.Test> declared in .Test.hashCode' type=.Test.Test> origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test visibility:private [final]' type=T of .Test origin=null - receiver: GET_VAR ': .Test.Test> declared in .Test.hashCode' type=.Test.Test> origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .Test.hashCode' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value=31 other: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.String' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .Test.Test> declared in .Test.hashCode' type=.Test.Test> origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test' + GET_VAR 'var result: kotlin.Int [var] declared in .Test.hashCode' type=kotlin.Int origin=null 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 diff --git a/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.txt b/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.txt index df50d1bc066..1df2c2ecbbc 100644 --- a/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.txt +++ b/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.txt @@ -81,25 +81,29 @@ FILE fqName: fileName:/dataClassMembers.kt public open fun hashCode (): kotlin.Int declared in kotlin.Any $this: VALUE_PARAMETER name: type:.Test.Test> BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test' + VAR name:result type:kotlin.Int [var] + WHEN type=kotlin.Int origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test visibility:private [final]' type=T of .Test origin=null + receiver: GET_VAR ': .Test.Test> declared in .Test.hashCode' type=.Test.Test> origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Int type=kotlin.Int value=0 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test visibility:private [final]' type=T of .Test origin=null + receiver: GET_VAR ': .Test.Test> declared in .Test.hashCode' type=.Test.Test> origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .Test.hashCode' type=kotlin.Unit origin=EQ CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: WHEN type=kotlin.Int origin=null - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test visibility:private [final]' type=T of .Test origin=null - receiver: GET_VAR ': .Test.Test> declared in .Test.hashCode' type=.Test.Test> origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of .Test visibility:private [final]' type=T of .Test origin=null - receiver: GET_VAR ': .Test.Test> declared in .Test.hashCode' type=.Test.Test> origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .Test.hashCode' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value=31 other: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.String' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .Test.Test> declared in .Test.hashCode' type=.Test.Test> origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test' + GET_VAR 'var result: kotlin.Int [var] declared in .Test.hashCode' type=kotlin.Int origin=null 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 diff --git a/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.txt b/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.txt index 91806386d48..ea4206cd8b8 100644 --- a/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.txt +++ b/compiler/testData/ir/irText/lambdas/destructuringInLambda.fir.txt @@ -105,16 +105,20 @@ FILE fqName: fileName:/destructuringInLambda.kt public open fun hashCode (): kotlin.Int declared in kotlin.Any $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.A BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .A' + 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 + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.hashCode' type=.A origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .A.hashCode' type=kotlin.Unit origin=EQ CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .A declared in .A.hashCode' type=.A origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .A.hashCode' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value=31 other: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .A declared in .A.hashCode' type=.A origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .A' + GET_VAR 'var result: kotlin.Int [var] declared in .A.hashCode' type=kotlin.Int origin=null 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 diff --git a/compiler/testData/ir/irText/lambdas/destructuringInLambda.txt b/compiler/testData/ir/irText/lambdas/destructuringInLambda.txt index 6ea354e2fc5..dbc0fdb1d04 100644 --- a/compiler/testData/ir/irText/lambdas/destructuringInLambda.txt +++ b/compiler/testData/ir/irText/lambdas/destructuringInLambda.txt @@ -77,16 +77,20 @@ FILE fqName: fileName:/destructuringInLambda.kt public open fun hashCode (): kotlin.Int declared in kotlin.Any $this: VALUE_PARAMETER name: type:.A BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .A' + 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 + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .A declared in .A.hashCode' type=.A origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .A.hashCode' type=kotlin.Unit origin=EQ CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .A declared in .A.hashCode' type=.A origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .A.hashCode' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value=31 other: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .A declared in .A.hashCode' type=.A origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .A' + GET_VAR 'var result: kotlin.Int [var] declared in .A.hashCode' type=kotlin.Int origin=null 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 diff --git a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.txt b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.txt index 896e4de23f6..a8bcb54b0c8 100644 --- a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.txt @@ -220,16 +220,20 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt public open fun hashCode (): kotlin.Int declared in kotlin.Any $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.P BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .P' + 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 + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .P declared in .P.hashCode' type=.P origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .P.hashCode' type=kotlin.Unit origin=EQ CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .P declared in .P.hashCode' type=.P origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .P.hashCode' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value=31 other: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .P declared in .P.hashCode' type=.P origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .P' + GET_VAR 'var result: kotlin.Int [var] declared in .P.hashCode' type=kotlin.Int origin=null 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 diff --git a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.txt b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.txt index 59756746401..69ea2b09d35 100644 --- a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.txt +++ b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.txt @@ -214,16 +214,20 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt public open fun hashCode (): kotlin.Int declared in kotlin.Any $this: VALUE_PARAMETER name: type:.P BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .P' + 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 + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + receiver: GET_VAR ': .P declared in .P.hashCode' type=.P origin=null + SET_VAR 'var result: kotlin.Int [var] declared in .P.hashCode' type=kotlin.Unit origin=EQ CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .P declared in .P.hashCode' type=.P origin=null + $this: GET_VAR 'var result: kotlin.Int [var] declared in .P.hashCode' type=kotlin.Int origin=null other: CONST Int type=kotlin.Int value=31 other: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .P declared in .P.hashCode' type=.P origin=null + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .P' + GET_VAR 'var result: kotlin.Int [var] declared in .P.hashCode' type=kotlin.Int origin=null 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 diff --git a/compiler/testData/ir/sourceRanges/declarations/synthesizedDataClassMembers.txt b/compiler/testData/ir/sourceRanges/declarations/synthesizedDataClassMembers.txt index b5c09ea3ba6..91c82cf8091 100644 --- a/compiler/testData/ir/sourceRanges/declarations/synthesizedDataClassMembers.txt +++ b/compiler/testData/ir/sourceRanges/declarations/synthesizedDataClassMembers.txt @@ -97,22 +97,28 @@ @0:0..4:1 FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.Int @0:0..4:1 VALUE_PARAMETER name: type:.C @0:0..4:1 BLOCK_BODY - @0:0..4:1 RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .C' + @0:0..4:1 VAR name:result type:kotlin.Int [var] + @0:0..4:1 CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null + @0:0..4:1 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + @0:0..4:1 GET_VAR ': .C declared in .C.hashCode' type=.C origin=null + @0:0..4:1 SET_VAR 'var result: kotlin.Int [var] declared in .C.hashCode' type=kotlin.Unit origin=EQ @0:0..4:1 CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null @0:0..4:1 CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - @0:0..4:1 CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - @0:0..4:1 CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - @0:0..4:1 CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null - @0:0..4:1 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - @0:0..4:1 GET_VAR ': .C declared in .C.hashCode' type=.C origin=null - @0:0..4:1 CONST Int type=kotlin.Int value=31 - @0:0..4:1 CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.String' type=kotlin.Int origin=null - @0:0..4:1 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - @0:0..4:1 GET_VAR ': .C declared in .C.hashCode' type=.C origin=null + @0:0..4:1 GET_VAR 'var result: kotlin.Int [var] declared in .C.hashCode' type=kotlin.Int origin=null + @0:0..4:1 CONST Int type=kotlin.Int value=31 + @0:0..4:1 CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.String' type=kotlin.Int origin=null + @0:0..4:1 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + @0:0..4:1 GET_VAR ': .C declared in .C.hashCode' type=.C origin=null + @0:0..4:1 SET_VAR 'var result: kotlin.Int [var] declared in .C.hashCode' type=kotlin.Unit origin=EQ + @0:0..4:1 CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + @0:0..4:1 CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + @0:0..4:1 GET_VAR 'var result: kotlin.Int [var] declared in .C.hashCode' type=kotlin.Int origin=null @0:0..4:1 CONST Int type=kotlin.Int value=31 @0:0..4:1 CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null @0:0..4:1 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null @0:0..4:1 GET_VAR ': .C declared in .C.hashCode' type=.C origin=null + @0:0..4:1 RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .C' + @0:0..4:1 GET_VAR 'var result: kotlin.Int [var] declared in .C.hashCode' type=kotlin.Int origin=null @0:0..4:1 FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.C, other:kotlin.Any?) returnType:kotlin.Boolean [operator] @0:0..4:1 VALUE_PARAMETER name: type:.C @0:0..4:1 VALUE_PARAMETER name:other index:0 type:kotlin.Any?