[IR] Do not generate line numbers for synthesized data class members.

Fixes KT-41903.
This commit is contained in:
Mads Ager
2020-09-21 12:08:46 +02:00
committed by Alexander Udalov
parent 5048471835
commit a37f16d7a2
9 changed files with 222 additions and 155 deletions
@@ -206,8 +206,7 @@ class DataClassMembersGenerator(val components: Fir2IrComponents) {
val index = getComponentIndex(irFunction)!!
val valueParameter = irClass.primaryConstructor!!.valueParameters[index - 1]
val backingField = irDataClassMembersGenerator.getBackingField(null, valueParameter)!!
irDataClassMembersGenerator
.generateComponentFunction(irFunction, backingField, valueParameter.startOffset, valueParameter.endOffset)
irDataClassMembersGenerator.generateComponentFunction(irFunction, backingField)
}
fun generateCopyBody(irFunction: IrFunction) =
@@ -22,11 +22,10 @@ import org.jetbrains.kotlin.ir.declarations.*
import org.jetbrains.kotlin.ir.expressions.IrMemberAccessExpression
import org.jetbrains.kotlin.ir.types.IrType
import org.jetbrains.kotlin.ir.util.DataClassMembersGenerator
import org.jetbrains.kotlin.ir.util.SYNTHETIC_OFFSET
import org.jetbrains.kotlin.ir.util.declareSimpleFunctionWithOverrides
import org.jetbrains.kotlin.psi.KtClassOrObject
import org.jetbrains.kotlin.psi.KtParameter
import org.jetbrains.kotlin.psi.psiUtil.endOffset
import org.jetbrains.kotlin.psi.psiUtil.startOffset
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils
@@ -93,9 +92,7 @@ class DataClassMembersGenerator(
?: throw AssertionError("No definition for data class constructor parameter $parameter")
val backingField = irDataClassMembersGenerator.getBackingField(parameter, null) ?: return
irDataClassMembersGenerator.generateComponentFunction(
function, backingField, ktParameter.startOffset, ktParameter.endOffset
)
irDataClassMembersGenerator.generateComponentFunction(function, backingField)
}
override fun generateCopyFunction(function: FunctionDescriptor, constructorParameters: List<KtParameter>) {
@@ -253,8 +253,8 @@ abstract class DataClassMembersGenerator(
// Build a member from a descriptor (psi2ir) as well as its body.
private inline fun buildMember(
function: FunctionDescriptor,
startOffset: Int = UNDEFINED_OFFSET,
endOffset: Int = UNDEFINED_OFFSET,
startOffset: Int = SYNTHETIC_OFFSET,
endOffset: Int = SYNTHETIC_OFFSET,
body: MemberFunctionBuilder.(IrFunction) -> Unit
) {
MemberFunctionBuilder(startOffset, endOffset, declareSimpleFunction(startOffset, endOffset, function)).addToClass { irFunction ->
@@ -268,8 +268,8 @@ abstract class DataClassMembersGenerator(
// Use a prebuilt member (fir2ir) and build a member body for it.
private inline fun buildMember(
irFunction: IrFunction,
startOffset: Int = UNDEFINED_OFFSET,
endOffset: Int = UNDEFINED_OFFSET,
startOffset: Int = SYNTHETIC_OFFSET,
endOffset: Int = SYNTHETIC_OFFSET,
body: MemberFunctionBuilder.(IrFunction) -> Unit
) {
MemberFunctionBuilder(startOffset, endOffset, irFunction).build { function ->
@@ -281,15 +281,15 @@ abstract class DataClassMembersGenerator(
}
// Entry for psi2ir
fun generateComponentFunction(function: FunctionDescriptor, irField: IrField, startOffset: Int, endOffset: Int) {
buildMember(function, startOffset, endOffset) {
fun generateComponentFunction(function: FunctionDescriptor, irField: IrField) {
buildMember(function) {
generateComponentFunction(irField)
}
}
// Entry for fir2ir
fun generateComponentFunction(irFunction: IrFunction, irField: IrField, startOffset: Int, endOffset: Int) {
buildMember(irFunction, startOffset, endOffset) {
fun generateComponentFunction(irFunction: IrFunction, irField: IrField) {
buildMember(irFunction) {
generateComponentFunction(irField)
}
}
@@ -300,7 +300,7 @@ abstract class DataClassMembersGenerator(
// Entry for psi2ir
fun generateCopyFunction(function: FunctionDescriptor, constructorSymbol: IrConstructorSymbol) {
buildMember(function, irClass.startOffset, irClass.endOffset) {
buildMember(function) {
function.valueParameters.forEach { parameter ->
putDefault(parameter, irGetField(irThis(), getBackingField(parameter, null)!!))
}
@@ -310,7 +310,7 @@ abstract class DataClassMembersGenerator(
// Entry for fir2ir
fun generateCopyFunction(irFunction: IrFunction, constructorSymbol: IrConstructorSymbol) {
buildMember(irFunction, irClass.startOffset, irClass.endOffset) {
buildMember(irFunction) {
irFunction.valueParameters.forEach { irValueParameter ->
irValueParameter.defaultValue = irExprBody(irGetField(irThis(), getBackingField(null, irValueParameter)!!))
}
@@ -320,14 +320,14 @@ abstract class DataClassMembersGenerator(
// Entry for psi2ir
fun generateEqualsMethod(function: FunctionDescriptor, properties: List<PropertyDescriptor>) {
buildMember(function, irClass.startOffset, irClass.endOffset) {
buildMember(function) {
generateEqualsMethodBody(properties)
}
}
// Entry for fir2ir
fun generateEqualsMethod(irFunction: IrFunction, properties: List<PropertyDescriptor>) {
buildMember(irFunction, irClass.startOffset, irClass.endOffset) {
buildMember(irFunction) {
generateEqualsMethodBody(properties)
}
}
@@ -368,28 +368,28 @@ abstract class DataClassMembersGenerator(
// Entry for psi2ir
fun generateHashCodeMethod(function: FunctionDescriptor, properties: List<PropertyDescriptor>) {
buildMember(function, irClass.startOffset, irClass.endOffset) {
buildMember(function) {
generateHashCodeMethodBody(properties)
}
}
// Entry for fir2ir
fun generateHashCodeMethod(irFunction: IrFunction, properties: List<PropertyDescriptor>) {
buildMember(irFunction, irClass.startOffset, irClass.endOffset) {
buildMember(irFunction) {
generateHashCodeMethodBody(properties)
}
}
// Entry for psi2ir
fun generateToStringMethod(function: FunctionDescriptor, properties: List<PropertyDescriptor>) {
buildMember(function, irClass.startOffset, irClass.endOffset) {
buildMember(function) {
generateToStringMethodBody(properties)
}
}
// Entry for fir2ir
fun generateToStringMethod(irFunction: IrFunction, properties: List<PropertyDescriptor>) {
buildMember(irFunction, irClass.startOffset, irClass.endOffset) {
buildMember(irFunction) {
generateToStringMethodBody(properties)
}
}
@@ -7,7 +7,6 @@ fun box() {
val b = a.copy(b = 3.0)
}
// IGNORE_BACKEND: JVM_IR
// LOCAL VARIABLES
// TestKt:6:
// someClass:3: a:double, b:double
+61
View File
@@ -0,0 +1,61 @@
// FILE: test.kt
data class D(val i: Int, val s: String)
data class E(val i: Int, val s: String) {
override fun toString() = "OK"
override fun equals(other: Any?) = false
override fun hashCode() = 42
fun copy() = E(i, s)
}
fun box() {
val d = D(1, "a")
d.equals(D(1, "a"))
d.hashCode()
d.toString()
val (i, s) = d
d.copy()
val e = E(1, "a")
e.equals(E(1, "a"))
e.hashCode()
e.toString()
val (s2, i2) = e
e.copy()
}
// LINENUMBERS
// test.kt:13 box
// test.kt:3 <init>
// test.kt:13 box
// test.kt:14 box
// test.kt:3 <init>
// test.kt:14 box
// test.kt:15 box
// test.kt:16 box
// test.kt:17 box
// test.kt:18 box
// test.kt:3 <init>
// test.kt:-1 copy
// test.kt:18 box
// test.kt:19 box
// test.kt:5 <init>
// test.kt:19 box
// test.kt:20 box
// test.kt:5 <init>
// test.kt:20 box
// test.kt:7 equals
// test.kt:20 box
// test.kt:21 box
// test.kt:8 hashCode
// test.kt:21 box
// test.kt:22 box
// test.kt:6 toString
// test.kt:22 box
// test.kt:23 box
// test.kt:24 box
// test.kt:9 copy
// test.kt:5 <init>
// test.kt:9 copy
// test.kt:24 box
// test.kt:25 box
@@ -38,136 +38,136 @@
@3:8..18 RETURN type=kotlin.Nothing from='public final fun <get-z> (): kotlin.Any declared in <root>.C'
@3:8..18 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null
@3:8..18 GET_VAR '<this>: <root>.C declared in <root>.C.<get-z>' type=<root>.C origin=null
@1:8..18 FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:<root>.C) returnType:kotlin.Int [operator]
@1:8..18 VALUE_PARAMETER name:<this> type:<root>.C
@1:8..18 BLOCK_BODY
@1:8..18 RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int [operator] declared in <root>.C'
@1:8..18 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
@1:8..18 GET_VAR '<this>: <root>.C declared in <root>.C.component1' type=<root>.C origin=null
@2:8..21 FUN GENERATED_DATA_CLASS_MEMBER name:component2 visibility:public modality:FINAL <> ($this:<root>.C) returnType:kotlin.String [operator]
@2:8..21 VALUE_PARAMETER name:<this> type:<root>.C
@2:8..21 BLOCK_BODY
@2:8..21 RETURN type=kotlin.Nothing from='public final fun component2 (): kotlin.String [operator] declared in <root>.C'
@2:8..21 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null
@2:8..21 GET_VAR '<this>: <root>.C declared in <root>.C.component2' type=<root>.C origin=null
@3:8..18 FUN GENERATED_DATA_CLASS_MEMBER name:component3 visibility:public modality:FINAL <> ($this:<root>.C) returnType:kotlin.Any [operator]
@3:8..18 VALUE_PARAMETER name:<this> type:<root>.C
@3:8..18 BLOCK_BODY
@3:8..18 RETURN type=kotlin.Nothing from='public final fun component3 (): kotlin.Any [operator] declared in <root>.C'
@3:8..18 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null
@3:8..18 GET_VAR '<this>: <root>.C declared in <root>.C.component3' type=<root>.C origin=null
@0:0..4:1 FUN GENERATED_DATA_CLASS_MEMBER name:copy visibility:public modality:FINAL <> ($this:<root>.C, x:kotlin.Int, y:kotlin.String, z:kotlin.Any) returnType:<root>.C
@0:0..4:1 VALUE_PARAMETER name:<this> type:<root>.C
@-1:-1..-1 FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:<root>.C) returnType:kotlin.Int [operator]
@-1:-1..-1 VALUE_PARAMETER name:<this> type:<root>.C
@-1:-1..-1 BLOCK_BODY
@-1:-1..-1 RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int [operator] declared in <root>.C'
@-1:-1..-1 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
@-1:-1..-1 GET_VAR '<this>: <root>.C declared in <root>.C.component1' type=<root>.C origin=null
@-1:-1..-1 FUN GENERATED_DATA_CLASS_MEMBER name:component2 visibility:public modality:FINAL <> ($this:<root>.C) returnType:kotlin.String [operator]
@-1:-1..-1 VALUE_PARAMETER name:<this> type:<root>.C
@-1:-1..-1 BLOCK_BODY
@-1:-1..-1 RETURN type=kotlin.Nothing from='public final fun component2 (): kotlin.String [operator] declared in <root>.C'
@-1:-1..-1 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null
@-1:-1..-1 GET_VAR '<this>: <root>.C declared in <root>.C.component2' type=<root>.C origin=null
@-1:-1..-1 FUN GENERATED_DATA_CLASS_MEMBER name:component3 visibility:public modality:FINAL <> ($this:<root>.C) returnType:kotlin.Any [operator]
@-1:-1..-1 VALUE_PARAMETER name:<this> type:<root>.C
@-1:-1..-1 BLOCK_BODY
@-1:-1..-1 RETURN type=kotlin.Nothing from='public final fun component3 (): kotlin.Any [operator] declared in <root>.C'
@-1:-1..-1 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null
@-1:-1..-1 GET_VAR '<this>: <root>.C declared in <root>.C.component3' type=<root>.C origin=null
@-1:-1..-1 FUN GENERATED_DATA_CLASS_MEMBER name:copy visibility:public modality:FINAL <> ($this:<root>.C, x:kotlin.Int, y:kotlin.String, z:kotlin.Any) returnType:<root>.C
@-1:-1..-1 VALUE_PARAMETER name:<this> type:<root>.C
@1:8..18 VALUE_PARAMETER name:x index:0 type:kotlin.Int
@0:0..4:1 EXPRESSION_BODY
@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 '<this>: <root>.C declared in <root>.C.copy' type=<root>.C origin=null
@-1:-1..-1 EXPRESSION_BODY
@-1:-1..-1 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
@-1:-1..-1 GET_VAR '<this>: <root>.C declared in <root>.C.copy' type=<root>.C origin=null
@2:8..21 VALUE_PARAMETER name:y index:1 type:kotlin.String
@0:0..4:1 EXPRESSION_BODY
@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 '<this>: <root>.C declared in <root>.C.copy' type=<root>.C origin=null
@-1:-1..-1 EXPRESSION_BODY
@-1:-1..-1 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null
@-1:-1..-1 GET_VAR '<this>: <root>.C declared in <root>.C.copy' type=<root>.C origin=null
@3:8..18 VALUE_PARAMETER name:z index:2 type:kotlin.Any
@0:0..4:1 EXPRESSION_BODY
@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 '<this>: <root>.C declared in <root>.C.copy' type=<root>.C origin=null
@0:0..4:1 BLOCK_BODY
@0:0..4:1 RETURN type=kotlin.Nothing from='public final fun copy (x: kotlin.Int, y: kotlin.String, z: kotlin.Any): <root>.C declared in <root>.C'
@0:0..4:1 CONSTRUCTOR_CALL 'public constructor <init> (x: kotlin.Int, y: kotlin.String, z: kotlin.Any) [primary] declared in <root>.C' type=<root>.C origin=null
@0:0..4:1 GET_VAR 'x: kotlin.Int declared in <root>.C.copy' type=kotlin.Int origin=null
@0:0..4:1 GET_VAR 'y: kotlin.String declared in <root>.C.copy' type=kotlin.String origin=null
@0:0..4:1 GET_VAR 'z: kotlin.Any declared in <root>.C.copy' type=kotlin.Any origin=null
@0:0..4:1 FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.C) returnType:kotlin.String
@0:0..4:1 VALUE_PARAMETER name:<this> type:<root>.C
@0:0..4:1 BLOCK_BODY
@0:0..4:1 RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.C'
@0:0..4:1 STRING_CONCATENATION type=kotlin.String
@0:0..4:1 CONST String type=kotlin.String value="C("
@0:0..4:1 CONST String type=kotlin.String value="x="
@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 '<this>: <root>.C declared in <root>.C.toString' type=<root>.C origin=null
@0:0..4:1 CONST String type=kotlin.String value=", "
@0:0..4:1 CONST String type=kotlin.String value="y="
@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 '<this>: <root>.C declared in <root>.C.toString' type=<root>.C origin=null
@0:0..4:1 CONST String type=kotlin.String value=", "
@0:0..4:1 CONST String type=kotlin.String value="z="
@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 '<this>: <root>.C declared in <root>.C.toString' type=<root>.C origin=null
@0:0..4:1 CONST String type=kotlin.String value=")"
@0:0..4:1 FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.C) returnType:kotlin.Int
@0:0..4:1 VALUE_PARAMETER name:<this> type:<root>.C
@0:0..4:1 BLOCK_BODY
@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 '<this>: <root>.C declared in <root>.C.hashCode' type=<root>.C origin=null
@0:0..4:1 SET_VAR 'var result: kotlin.Int [var] declared in <root>.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 <root>.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 '<this>: <root>.C declared in <root>.C.hashCode' type=<root>.C origin=null
@0:0..4:1 SET_VAR 'var result: kotlin.Int [var] declared in <root>.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 <root>.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 '<this>: <root>.C declared in <root>.C.hashCode' type=<root>.C origin=null
@0:0..4:1 RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in <root>.C'
@0:0..4:1 GET_VAR 'var result: kotlin.Int [var] declared in <root>.C.hashCode' type=kotlin.Int origin=null
@0:0..4:1 FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.C, other:kotlin.Any?) returnType:kotlin.Boolean [operator]
@0:0..4:1 VALUE_PARAMETER name:<this> type:<root>.C
@0:0..4:1 VALUE_PARAMETER name:other index:0 type:kotlin.Any?
@0:0..4:1 BLOCK_BODY
@0:0..4:1 WHEN type=kotlin.Unit origin=null
@0:0..4:1 BRANCH
@0:0..4:1 CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ
@0:0..4:1 GET_VAR '<this>: <root>.C declared in <root>.C.equals' type=<root>.C origin=null
@0:0..4:1 GET_VAR 'other: kotlin.Any? declared in <root>.C.equals' type=kotlin.Any? origin=null
@0:0..4:1 RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in <root>.C'
@0:0..4:1 CONST Boolean type=kotlin.Boolean value=true
@0:0..4:1 WHEN type=kotlin.Unit origin=null
@0:0..4:1 BRANCH
@0:0..4:1 TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=<root>.C
@0:0..4:1 GET_VAR 'other: kotlin.Any? declared in <root>.C.equals' type=kotlin.Any? origin=null
@0:0..4:1 RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in <root>.C'
@0:0..4:1 CONST Boolean type=kotlin.Boolean value=false
@0:0..4:1 VAR IR_TEMPORARY_VARIABLE name:tmp0_other_with_cast type:<root>.C [val]
@0:0..4:1 TYPE_OP type=<root>.C origin=CAST typeOperand=<root>.C
@0:0..4:1 GET_VAR 'other: kotlin.Any? declared in <root>.C.equals' type=kotlin.Any? origin=null
@0:0..4:1 WHEN type=kotlin.Unit origin=null
@0:0..4:1 BRANCH
@0:0..4:1 CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
@0:0..4:1 CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
@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 '<this>: <root>.C declared in <root>.C.equals' type=<root>.C 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 'val tmp0_other_with_cast: <root>.C [val] declared in <root>.C.equals' type=<root>.C origin=null
@0:0..4:1 RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in <root>.C'
@0:0..4:1 CONST Boolean type=kotlin.Boolean value=false
@0:0..4:1 WHEN type=kotlin.Unit origin=null
@0:0..4:1 BRANCH
@0:0..4:1 CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
@0:0..4:1 CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
@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 '<this>: <root>.C declared in <root>.C.equals' type=<root>.C 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 'val tmp0_other_with_cast: <root>.C [val] declared in <root>.C.equals' type=<root>.C origin=null
@0:0..4:1 RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in <root>.C'
@0:0..4:1 CONST Boolean type=kotlin.Boolean value=false
@0:0..4:1 WHEN type=kotlin.Unit origin=null
@0:0..4:1 BRANCH
@0:0..4:1 CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
@0:0..4:1 CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
@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 '<this>: <root>.C declared in <root>.C.equals' type=<root>.C 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 'val tmp0_other_with_cast: <root>.C [val] declared in <root>.C.equals' type=<root>.C origin=null
@0:0..4:1 RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in <root>.C'
@0:0..4:1 CONST Boolean type=kotlin.Boolean value=false
@0:0..4:1 RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in <root>.C'
@0:0..4:1 CONST Boolean type=kotlin.Boolean value=true
@-1:-1..-1 EXPRESSION_BODY
@-1:-1..-1 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null
@-1:-1..-1 GET_VAR '<this>: <root>.C declared in <root>.C.copy' type=<root>.C origin=null
@-1:-1..-1 BLOCK_BODY
@-1:-1..-1 RETURN type=kotlin.Nothing from='public final fun copy (x: kotlin.Int, y: kotlin.String, z: kotlin.Any): <root>.C declared in <root>.C'
@-1:-1..-1 CONSTRUCTOR_CALL 'public constructor <init> (x: kotlin.Int, y: kotlin.String, z: kotlin.Any) [primary] declared in <root>.C' type=<root>.C origin=null
@-1:-1..-1 GET_VAR 'x: kotlin.Int declared in <root>.C.copy' type=kotlin.Int origin=null
@-1:-1..-1 GET_VAR 'y: kotlin.String declared in <root>.C.copy' type=kotlin.String origin=null
@-1:-1..-1 GET_VAR 'z: kotlin.Any declared in <root>.C.copy' type=kotlin.Any origin=null
@-1:-1..-1 FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:<root>.C) returnType:kotlin.String
@-1:-1..-1 VALUE_PARAMETER name:<this> type:<root>.C
@-1:-1..-1 BLOCK_BODY
@-1:-1..-1 RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.C'
@-1:-1..-1 STRING_CONCATENATION type=kotlin.String
@-1:-1..-1 CONST String type=kotlin.String value="C("
@-1:-1..-1 CONST String type=kotlin.String value="x="
@-1:-1..-1 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
@-1:-1..-1 GET_VAR '<this>: <root>.C declared in <root>.C.toString' type=<root>.C origin=null
@-1:-1..-1 CONST String type=kotlin.String value=", "
@-1:-1..-1 CONST String type=kotlin.String value="y="
@-1:-1..-1 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null
@-1:-1..-1 GET_VAR '<this>: <root>.C declared in <root>.C.toString' type=<root>.C origin=null
@-1:-1..-1 CONST String type=kotlin.String value=", "
@-1:-1..-1 CONST String type=kotlin.String value="z="
@-1:-1..-1 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null
@-1:-1..-1 GET_VAR '<this>: <root>.C declared in <root>.C.toString' type=<root>.C origin=null
@-1:-1..-1 CONST String type=kotlin.String value=")"
@-1:-1..-1 FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:<root>.C) returnType:kotlin.Int
@-1:-1..-1 VALUE_PARAMETER name:<this> type:<root>.C
@-1:-1..-1 BLOCK_BODY
@-1:-1..-1 VAR name:result type:kotlin.Int [var]
@-1:-1..-1 CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null
@-1:-1..-1 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
@-1:-1..-1 GET_VAR '<this>: <root>.C declared in <root>.C.hashCode' type=<root>.C origin=null
@-1:-1..-1 SET_VAR 'var result: kotlin.Int [var] declared in <root>.C.hashCode' type=kotlin.Unit origin=EQ
@-1:-1..-1 CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
@-1:-1..-1 CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
@-1:-1..-1 GET_VAR 'var result: kotlin.Int [var] declared in <root>.C.hashCode' type=kotlin.Int origin=null
@-1:-1..-1 CONST Int type=kotlin.Int value=31
@-1:-1..-1 CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.String' type=kotlin.Int origin=null
@-1:-1..-1 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null
@-1:-1..-1 GET_VAR '<this>: <root>.C declared in <root>.C.hashCode' type=<root>.C origin=null
@-1:-1..-1 SET_VAR 'var result: kotlin.Int [var] declared in <root>.C.hashCode' type=kotlin.Unit origin=EQ
@-1:-1..-1 CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
@-1:-1..-1 CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
@-1:-1..-1 GET_VAR 'var result: kotlin.Int [var] declared in <root>.C.hashCode' type=kotlin.Int origin=null
@-1:-1..-1 CONST Int type=kotlin.Int value=31
@-1:-1..-1 CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null
@-1:-1..-1 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null
@-1:-1..-1 GET_VAR '<this>: <root>.C declared in <root>.C.hashCode' type=<root>.C origin=null
@-1:-1..-1 RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in <root>.C'
@-1:-1..-1 GET_VAR 'var result: kotlin.Int [var] declared in <root>.C.hashCode' type=kotlin.Int origin=null
@-1:-1..-1 FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.C, other:kotlin.Any?) returnType:kotlin.Boolean [operator]
@-1:-1..-1 VALUE_PARAMETER name:<this> type:<root>.C
@-1:-1..-1 VALUE_PARAMETER name:other index:0 type:kotlin.Any?
@-1:-1..-1 BLOCK_BODY
@-1:-1..-1 WHEN type=kotlin.Unit origin=null
@-1:-1..-1 BRANCH
@-1:-1..-1 CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ
@-1:-1..-1 GET_VAR '<this>: <root>.C declared in <root>.C.equals' type=<root>.C origin=null
@-1:-1..-1 GET_VAR 'other: kotlin.Any? declared in <root>.C.equals' type=kotlin.Any? origin=null
@-1:-1..-1 RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in <root>.C'
@-1:-1..-1 CONST Boolean type=kotlin.Boolean value=true
@-1:-1..-1 WHEN type=kotlin.Unit origin=null
@-1:-1..-1 BRANCH
@-1:-1..-1 TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=<root>.C
@-1:-1..-1 GET_VAR 'other: kotlin.Any? declared in <root>.C.equals' type=kotlin.Any? origin=null
@-1:-1..-1 RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in <root>.C'
@-1:-1..-1 CONST Boolean type=kotlin.Boolean value=false
@-1:-1..-1 VAR IR_TEMPORARY_VARIABLE name:tmp0_other_with_cast type:<root>.C [val]
@-1:-1..-1 TYPE_OP type=<root>.C origin=CAST typeOperand=<root>.C
@-1:-1..-1 GET_VAR 'other: kotlin.Any? declared in <root>.C.equals' type=kotlin.Any? origin=null
@-1:-1..-1 WHEN type=kotlin.Unit origin=null
@-1:-1..-1 BRANCH
@-1:-1..-1 CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
@-1:-1..-1 CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
@-1:-1..-1 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
@-1:-1..-1 GET_VAR '<this>: <root>.C declared in <root>.C.equals' type=<root>.C origin=null
@-1:-1..-1 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
@-1:-1..-1 GET_VAR 'val tmp0_other_with_cast: <root>.C [val] declared in <root>.C.equals' type=<root>.C origin=null
@-1:-1..-1 RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in <root>.C'
@-1:-1..-1 CONST Boolean type=kotlin.Boolean value=false
@-1:-1..-1 WHEN type=kotlin.Unit origin=null
@-1:-1..-1 BRANCH
@-1:-1..-1 CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
@-1:-1..-1 CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
@-1:-1..-1 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null
@-1:-1..-1 GET_VAR '<this>: <root>.C declared in <root>.C.equals' type=<root>.C origin=null
@-1:-1..-1 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null
@-1:-1..-1 GET_VAR 'val tmp0_other_with_cast: <root>.C [val] declared in <root>.C.equals' type=<root>.C origin=null
@-1:-1..-1 RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in <root>.C'
@-1:-1..-1 CONST Boolean type=kotlin.Boolean value=false
@-1:-1..-1 WHEN type=kotlin.Unit origin=null
@-1:-1..-1 BRANCH
@-1:-1..-1 CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
@-1:-1..-1 CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
@-1:-1..-1 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null
@-1:-1..-1 GET_VAR '<this>: <root>.C declared in <root>.C.equals' type=<root>.C origin=null
@-1:-1..-1 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null
@-1:-1..-1 GET_VAR 'val tmp0_other_with_cast: <root>.C [val] declared in <root>.C.equals' type=<root>.C origin=null
@-1:-1..-1 RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in <root>.C'
@-1:-1..-1 CONST Boolean type=kotlin.Boolean value=false
@-1:-1..-1 RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in <root>.C'
@-1:-1..-1 CONST Boolean type=kotlin.Boolean value=true
@@ -109,6 +109,12 @@ public class IrSteppingTestGenerated extends AbstractIrSteppingTest {
runTest("compiler/testData/debug/stepping/constructors.kt");
}
@Test
@TestMetadata("dataClass.kt")
public void testDataClass() throws Exception {
runTest("compiler/testData/debug/stepping/dataClass.kt");
}
@Test
@TestMetadata("defaultParameter.kt")
public void testDefaultParameter() throws Exception {
@@ -109,6 +109,12 @@ public class SteppingTestGenerated extends AbstractSteppingTest {
runTest("compiler/testData/debug/stepping/constructors.kt");
}
@Test
@TestMetadata("dataClass.kt")
public void testDataClass() throws Exception {
runTest("compiler/testData/debug/stepping/dataClass.kt");
}
@Test
@TestMetadata("defaultParameter.kt")
public void testDefaultParameter() throws Exception {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
LineBreakpoint created at dataClassCopy.kt:6
Run Java
Connected to the target VM