FIR: fix body generation for data class's copy method

This commit is contained in:
Jinseong Jeon
2020-04-13 10:46:04 -07:00
committed by Mikhail Glukhikh
parent 948f9debdc
commit 08b91da6db
23 changed files with 162 additions and 32 deletions
@@ -28,6 +28,7 @@ FILE: constantValues.kt
}
public final fun copy(classId: R|ClassId| = this@R|/ClassLiteralValue|.R|/ClassLiteralValue.classId|, arrayNestedness: R|kotlin/Int| = this@R|/ClassLiteralValue|.R|/ClassLiteralValue.arrayNestedness|): R|ClassLiteralValue| {
^copy R|/ClassLiteralValue.ClassLiteralValue|(this@R|/ClassLiteralValue|.R|/ClassLiteralValue.classId|, this@R|/ClassLiteralValue|.R|/ClassLiteralValue.arrayNestedness|)
}
}
@@ -72,6 +73,7 @@ FILE: constantValues.kt
}
public final fun copy(value: R|ClassLiteralValue| = this@R|/KClassValue.Value.NormalClass|.R|/KClassValue.Value.NormalClass.value|): R|KClassValue.Value.NormalClass| {
^copy R|/KClassValue.Value.NormalClass.NormalClass|(this@R|/KClassValue.Value.NormalClass|.R|/KClassValue.Value.NormalClass.value|)
}
}
@@ -89,6 +91,7 @@ FILE: constantValues.kt
}
public final fun copy(type: R|KotlinType| = this@R|/KClassValue.Value.LocalClass|.R|/KClassValue.Value.LocalClass.type|): R|KClassValue.Value.LocalClass| {
^copy R|/KClassValue.Value.LocalClass.LocalClass|(this@R|/KClassValue.Value.LocalClass|.R|/KClassValue.Value.LocalClass.type|)
}
}
+1
View File
@@ -19,6 +19,7 @@ FILE: copy.kt
}
public final fun copy(x: R|kotlin/Int| = this@R|/Some|.R|/Some.x|, y: R|kotlin/String| = this@R|/Some|.R|/Some.y|): R|Some| {
^copy R|/Some.Some|(this@R|/Some|.R|/Some.x|, this@R|/Some|.R|/Some.y|)
}
}
@@ -56,6 +56,7 @@ FILE: incompatibleModifiers.kt
}
public final fun copy(i: R|kotlin/Int| = this@R|/H|.R|/H.i|): R|H| {
^copy R|/H.H|(this@R|/H|.R|/H.i|)
}
}
@@ -72,6 +73,7 @@ FILE: incompatibleModifiers.kt
}
public final fun copy(i: R|kotlin/Int| = this@R|/I|.R|/I.i|): R|I| {
^copy R|/I.I|(this@R|/I|.R|/I.i|)
}
}
@@ -88,6 +90,7 @@ FILE: incompatibleModifiers.kt
}
public final fun copy(i: R|kotlin/Int| = this@R|/J|.R|/J.i|): R|J| {
^copy R|/J.J|(this@R|/J|.R|/J.i|)
}
}
@@ -133,6 +136,7 @@ FILE: incompatibleModifiers.kt
}
public final fun copy(i: R|kotlin/Int| = this@R|/X.Y|.R|/X.Y.i|): R|X.Y| {
^copy R|/X.Y.Y|(this@R|/X.Y|.R|/X.Y.i|)
}
}
@@ -55,6 +55,7 @@ FILE: problems2.kt
}
public final fun copy(x: R|kotlin/Int| = this@R|/Some.WithPrimary|.R|/Some.WithPrimary.x|, arr: R|kotlin/Array<kotlin/String>?| = this@R|/Some.WithPrimary|.R|/Some.WithPrimary.arr|, s: R|kotlin/String?| = this@R|/Some.WithPrimary|.R|/Some.WithPrimary.s|): R|Some.WithPrimary| {
^copy R|/Some.WithPrimary.WithPrimary|(this@R|/Some.WithPrimary|.R|/Some.WithPrimary.x|, this@R|/Some.WithPrimary|.R|/Some.WithPrimary.arr|, this@R|/Some.WithPrimary|.R|/Some.WithPrimary.s|)
}
}
@@ -19,6 +19,7 @@ FILE: components.kt
}
public final fun copy(x: R|kotlin/Int| = this@R|/D|.R|/D.x|, y: R|kotlin/String| = this@R|/D|.R|/D.y|): R|D| {
^copy R|/D.D|(this@R|/D|.R|/D.x|, this@R|/D|.R|/D.y|)
}
}
@@ -642,23 +642,24 @@ abstract class BaseFirBuilder<T>(val baseSession: FirSession, val context: Conte
}
}
inner class DataClassMemberGenerator(
inner class DataClassMembersGenerator(
private val session: FirSession,
private val source: T,
private val classBuilder: AbstractFirRegularClassBuilder,
private val classTypeRef: FirTypeRef,
private val primaryConstructor: FirConstructor,
private val zippedParameters: List<Pair<T, FirProperty>>,
private val packageFqName: FqName,
private val classFqName: FqName,
) {
private val classTypeRef = primaryConstructor.returnTypeRef
fun generateMembers() {
fun generate() {
generateComponentFunctions()
generateCopyFunction()
// TODO: equals, hashCode, toString
// Refer to (IR utils or FIR backend) DataClassMembersGenerator for generating equals, hashCode, and toString
}
private inline fun generateComponentAccess(parameterSource: FirSourceElement?, firProperty: FirProperty) =
private fun generateComponentAccess(parameterSource: FirSourceElement?, firProperty: FirProperty) =
buildQualifiedAccessExpression {
source = parameterSource
dispatchReceiver = buildThisReceiverExpression {
@@ -684,10 +685,8 @@ abstract class BaseFirBuilder<T>(val baseSession: FirSession, val context: Conte
val target = FirFunctionTarget(labelName = null, isLambda = false)
val componentFunction = buildSimpleFunction {
source = parameterSource
session = this@DataClassMemberGenerator.session
returnTypeRef = buildImplicitTypeRef {
source = parameterSource
}
session = this@DataClassMembersGenerator.session
returnTypeRef = firProperty.returnTypeRef
receiverTypeRef = null
this.name = name
status = FirDeclarationStatusImpl(Visibilities.PUBLIC, Modality.FINAL)
@@ -709,10 +708,11 @@ abstract class BaseFirBuilder<T>(val baseSession: FirSession, val context: Conte
private val copyName = Name.identifier("copy")
private fun generateCopyFunction() {
val target = FirFunctionTarget(labelName = null, isLambda = false)
classBuilder.addDeclaration(
buildSimpleFunction {
source = this@DataClassMemberGenerator.source.toFirSourceElement()
session = this@DataClassMemberGenerator.session
source = this@DataClassMembersGenerator.source.toFirSourceElement()
session = this@DataClassMembersGenerator.session
returnTypeRef = classTypeRef
name = copyName
status = FirDeclarationStatusImpl(Visibilities.PUBLIC, Modality.FINAL)
@@ -722,7 +722,7 @@ abstract class BaseFirBuilder<T>(val baseSession: FirSession, val context: Conte
val parameterSource = ktParameter?.toFirSourceElement()
valueParameters += buildValueParameter {
source = parameterSource
session = this@DataClassMemberGenerator.session
session = this@DataClassMembersGenerator.session
returnTypeRef = firProperty.returnTypeRef
name = propertyName
symbol = FirVariableSymbol(propertyName)
@@ -733,8 +733,27 @@ abstract class BaseFirBuilder<T>(val baseSession: FirSession, val context: Conte
}
}
body = buildEmptyExpressionBlock()
},
// TODO: Handle generic types.
val initCallExpression = buildFunctionCall {
argumentList = buildArgumentList {
for ((ktParameter, firProperty) in zippedParameters) {
val parameterSource = ktParameter?.toFirSourceElement()
arguments += generateComponentAccess(parameterSource, firProperty)
}
}
calleeReference = buildResolvedNamedReference {
name = primaryConstructor.symbol.callableId.callableName
resolvedSymbol = primaryConstructor.symbol
}
}
val returnExpression = buildReturnExpression {
result = initCallExpression
this.target = target
}
body = buildSingleExpressionBlock(returnExpression)
}.also {
target.bind(it)
}
)
}
}
@@ -412,7 +412,6 @@ class DeclarationsConverter(
delegationSpecifiers?.let { superTypeRefs += it.superTypesRef }
when {
modifiers.isEnum() && (classKind == ClassKind.ENUM_CLASS) -> {
delegatedSuperTypeRef = buildResolvedTypeRef {
@@ -467,15 +466,15 @@ class DeclarationsConverter(
//parse data class
if (modifiers.isDataClass() && firPrimaryConstructor != null) {
val zippedParameters = properties.map { it.source?.lightNode!! to it }
DataClassMemberGenerator(
DataClassMembersGenerator(
baseSession,
classNode,
this,
firPrimaryConstructor.returnTypeRef,
firPrimaryConstructor,
zippedParameters,
context.packageFqName,
context.className
).generateMembers()
).generate()
}
if (modifiers.isEnum()) {
@@ -161,7 +161,7 @@ class RawFirBuilder(
delegatedSuperType: FirTypeRef,
delegatedSelfType: FirResolvedTypeRef,
owner: KtClassOrObject,
ownerClassBuilder: FirClassBuilder, hasPrimaryConstructor: Boolean,
ownerClassBuilder: FirClassBuilder, hasPrimaryConstructor: Boolean,
ownerTypeParameters: List<FirTypeParameterRef>
): FirDeclaration {
return when (this) {
@@ -693,15 +693,15 @@ class RawFirBuilder(
val zippedParameters = classOrObject.primaryConstructorParameters.zip(
declarations.filterIsInstance<FirProperty>(),
)
DataClassMemberGenerator(
DataClassMembersGenerator(
baseSession,
classOrObject,
this,
firPrimaryConstructor.returnTypeRef,
firPrimaryConstructor,
zippedParameters,
context.packageFqName,
context.className
).generateMembers()
).generate()
}
if (classOrObject.hasModifier(ENUM_KEYWORD)) {
@@ -26,6 +26,7 @@ FILE: annotated.kt
}
public final fun copy(): R|Two| {
^copy R|/Two.Two|()
}
}
@@ -13,19 +13,20 @@ FILE: destructuring.kt
public? final? val third: String = R|<local>/third|
public? get(): String
public final fun component1(): <implicit> {
public final fun component1(): Int {
^component1 this@R|/Some|.R|/Some.first|
}
public final fun component2(): <implicit> {
public final fun component2(): Double {
^component2 this@R|/Some|.R|/Some.second|
}
public final fun component3(): <implicit> {
public final fun component3(): String {
^component3 this@R|/Some|.R|/Some.third|
}
public final fun copy(first: Int = this@R|/Some|.R|/Some.first|, second: Double = this@R|/Some|.R|/Some.second|, third: String = this@R|/Some|.R|/Some.third|): R|Some| {
^copy R|/Some.Some|(this@R|/Some|.R|/Some.first|, this@R|/Some|.R|/Some.second|, this@R|/Some|.R|/Some.third|)
}
}
@@ -48,15 +48,16 @@ FILE: for.kt
public? final? val y: Int = R|<local>/y|
public? get(): Int
public final fun component1(): <implicit> {
public final fun component1(): Int {
^component1 this@R|/Some|.R|/Some.x|
}
public final fun component2(): <implicit> {
public final fun component2(): Int {
^component2 this@R|/Some|.R|/Some.y|
}
public final fun copy(x: Int = this@R|/Some|.R|/Some.x|, y: Int = this@R|/Some|.R|/Some.y|): R|Some| {
^copy R|/Some.Some|(this@R|/Some|.R|/Some.x|, this@R|/Some|.R|/Some.y|)
}
}
@@ -10,15 +10,16 @@ FILE: lambda.kt
public? final? val y: Int = R|<local>/y|
public? get(): Int
public final fun component1(): <implicit> {
public final fun component1(): Int {
^component1 this@R|/Tuple|.R|/Tuple.x|
}
public final fun component2(): <implicit> {
public final fun component2(): Int {
^component2 this@R|/Tuple|.R|/Tuple.y|
}
public final fun copy(x: Int = this@R|/Tuple|.R|/Tuple.x|, y: Int = this@R|/Tuple|.R|/Tuple.y|): R|Tuple| {
^copy R|/Tuple.Tuple|(this@R|/Tuple|.R|/Tuple.x|, this@R|/Tuple|.R|/Tuple.y|)
}
}
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
interface Id<T> {
val id: T
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
data class A(val a: Double, val b: Double)
fun box() : String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun box(): String {
val capturedInConstructor = 1
@@ -206,6 +206,26 @@ FILE fqName:<root> fileName:/dataClassWithArrayMembers.kt
CALL 'public final fun <get-doubleArray> (): kotlin.DoubleArray declared in <root>.Test1' type=kotlin.DoubleArray origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test1 declared in <root>.Test1.copy' type=<root>.Test1 origin=null
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun copy (stringArray: kotlin.Array<kotlin.String>, charArray: kotlin.CharArray, booleanArray: kotlin.BooleanArray, byteArray: kotlin.ByteArray, shortArray: kotlin.ShortArray, intArray: kotlin.IntArray, longArray: kotlin.LongArray, floatArray: kotlin.FloatArray, doubleArray: kotlin.DoubleArray): <root>.Test1 declared in <root>.Test1'
CONSTRUCTOR_CALL 'public constructor <init> (stringArray: kotlin.Array<kotlin.String>, charArray: kotlin.CharArray, booleanArray: kotlin.BooleanArray, byteArray: kotlin.ByteArray, shortArray: kotlin.ShortArray, intArray: kotlin.IntArray, longArray: kotlin.LongArray, floatArray: kotlin.FloatArray, doubleArray: kotlin.DoubleArray) [primary] declared in <root>.Test1' type=<root>.Test1 origin=null
stringArray: CALL 'public final fun <get-stringArray> (): kotlin.Array<kotlin.String> declared in <root>.Test1' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test1 declared in <root>.Test1.copy' type=<root>.Test1 origin=null
charArray: CALL 'public final fun <get-charArray> (): kotlin.CharArray declared in <root>.Test1' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test1 declared in <root>.Test1.copy' type=<root>.Test1 origin=null
booleanArray: CALL 'public final fun <get-booleanArray> (): kotlin.BooleanArray declared in <root>.Test1' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test1 declared in <root>.Test1.copy' type=<root>.Test1 origin=null
byteArray: CALL 'public final fun <get-byteArray> (): kotlin.ByteArray declared in <root>.Test1' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test1 declared in <root>.Test1.copy' type=<root>.Test1 origin=null
shortArray: CALL 'public final fun <get-shortArray> (): kotlin.ShortArray declared in <root>.Test1' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test1 declared in <root>.Test1.copy' type=<root>.Test1 origin=null
intArray: CALL 'public final fun <get-intArray> (): kotlin.IntArray declared in <root>.Test1' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test1 declared in <root>.Test1.copy' type=<root>.Test1 origin=null
longArray: CALL 'public final fun <get-longArray> (): kotlin.LongArray declared in <root>.Test1' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test1 declared in <root>.Test1.copy' type=<root>.Test1 origin=null
floatArray: CALL 'public final fun <get-floatArray> (): kotlin.FloatArray declared in <root>.Test1' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test1 declared in <root>.Test1.copy' type=<root>.Test1 origin=null
doubleArray: CALL 'public final fun <get-doubleArray> (): kotlin.DoubleArray declared in <root>.Test1' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test1 declared in <root>.Test1.copy' type=<root>.Test1 origin=null
FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.Test1, other:kotlin.Any?) returnType:kotlin.Boolean
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.Test1
VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any?
@@ -456,6 +476,11 @@ FILE fqName:<root> fileName:/dataClassWithArrayMembers.kt
CALL 'public final fun <get-genericArray> (): kotlin.Array<T of <root>.Test2> declared in <root>.Test2' type=kotlin.Array<T of <root>.Test2> origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test2<T of <root>.Test2> declared in <root>.Test2.copy' type=<root>.Test2<T of <root>.Test2> origin=null
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun copy (genericArray: kotlin.Array<T of <root>.Test2>): <root>.Test2<T of <root>.Test2> declared in <root>.Test2'
CONSTRUCTOR_CALL 'public constructor <init> (genericArray: kotlin.Array<T of <root>.Test2>) [primary] declared in <root>.Test2' type=<root>.Test2<T of <root>.Test2> origin=null
<class: T>: <none>
genericArray: CALL 'public final fun <get-genericArray> (): kotlin.Array<T of <root>.Test2> declared in <root>.Test2' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test2<T of <root>.Test2> declared in <root>.Test2.copy' type=<root>.Test2<T of <root>.Test2> origin=null
FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.Test2<T of <root>.Test2>, other:kotlin.Any?) returnType:kotlin.Boolean
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.Test2<T of <root>.Test2>
VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any?
@@ -537,6 +562,10 @@ FILE fqName:<root> fileName:/dataClassWithArrayMembers.kt
CALL 'public final fun <get-anyArrayN> (): kotlin.Array<kotlin.Any>? declared in <root>.Test3' type=kotlin.Array<kotlin.Any>? origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test3 declared in <root>.Test3.copy' type=<root>.Test3 origin=null
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun copy (anyArrayN: kotlin.Array<kotlin.Any>?): <root>.Test3 declared in <root>.Test3'
CONSTRUCTOR_CALL 'public constructor <init> (anyArrayN: kotlin.Array<kotlin.Any>?) [primary] declared in <root>.Test3' type=<root>.Test3 origin=null
anyArrayN: CALL 'public final fun <get-anyArrayN> (): kotlin.Array<kotlin.Any>? declared in <root>.Test3' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test3 declared in <root>.Test3.copy' type=<root>.Test3 origin=null
FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.Test3, other:kotlin.Any?) returnType:kotlin.Boolean
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.Test3
VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any?
+22
View File
@@ -74,6 +74,14 @@ FILE fqName:<root> fileName:/dataClasses.kt
CALL 'public final fun <get-z> (): kotlin.Any declared in <root>.Test1' type=kotlin.Any origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test1 declared in <root>.Test1.copy' type=<root>.Test1 origin=null
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun copy (x: kotlin.Int, y: kotlin.String, z: kotlin.Any): <root>.Test1 declared in <root>.Test1'
CONSTRUCTOR_CALL 'public constructor <init> (x: kotlin.Int, y: kotlin.String, z: kotlin.Any) [primary] declared in <root>.Test1' type=<root>.Test1 origin=null
x: CALL 'public final fun <get-x> (): kotlin.Int declared in <root>.Test1' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test1 declared in <root>.Test1.copy' type=<root>.Test1 origin=null
y: CALL 'public final fun <get-y> (): kotlin.String declared in <root>.Test1' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test1 declared in <root>.Test1.copy' type=<root>.Test1 origin=null
z: CALL 'public final fun <get-z> (): kotlin.Any declared in <root>.Test1' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test1 declared in <root>.Test1.copy' type=<root>.Test1 origin=null
FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.Test1, other:kotlin.Any?) returnType:kotlin.Boolean
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.Test1
VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any?
@@ -194,6 +202,10 @@ FILE fqName:<root> fileName:/dataClasses.kt
CALL 'public final fun <get-x> (): kotlin.Any? declared in <root>.Test2' type=kotlin.Any? origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2.copy' type=<root>.Test2 origin=null
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun copy (x: kotlin.Any?): <root>.Test2 declared in <root>.Test2'
CONSTRUCTOR_CALL 'public constructor <init> (x: kotlin.Any?) [primary] declared in <root>.Test2' type=<root>.Test2 origin=null
x: CALL 'public final fun <get-x> (): kotlin.Any? declared in <root>.Test2' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2.copy' type=<root>.Test2 origin=null
FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.Test2, other:kotlin.Any?) returnType:kotlin.Boolean
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.Test2
VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any?
@@ -349,6 +361,16 @@ FILE fqName:<root> fileName:/dataClasses.kt
CALL 'public final fun <get-df> (): kotlin.Float? declared in <root>.Test3' type=kotlin.Float? origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test3 declared in <root>.Test3.copy' type=<root>.Test3 origin=null
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun copy (d: kotlin.Double, dn: kotlin.Double?, f: kotlin.Float, df: kotlin.Float?): <root>.Test3 declared in <root>.Test3'
CONSTRUCTOR_CALL 'public constructor <init> (d: kotlin.Double, dn: kotlin.Double?, f: kotlin.Float, df: kotlin.Float?) [primary] declared in <root>.Test3' type=<root>.Test3 origin=null
d: CALL 'public final fun <get-d> (): kotlin.Double declared in <root>.Test3' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test3 declared in <root>.Test3.copy' type=<root>.Test3 origin=null
dn: CALL 'public final fun <get-dn> (): kotlin.Double? declared in <root>.Test3' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test3 declared in <root>.Test3.copy' type=<root>.Test3 origin=null
f: CALL 'public final fun <get-f> (): kotlin.Float declared in <root>.Test3' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test3 declared in <root>.Test3.copy' type=<root>.Test3 origin=null
df: CALL 'public final fun <get-df> (): kotlin.Float? declared in <root>.Test3' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test3 declared in <root>.Test3.copy' type=<root>.Test3 origin=null
FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.Test3, other:kotlin.Any?) returnType:kotlin.Boolean
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.Test3
VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any?
@@ -31,6 +31,11 @@ FILE fqName:<root> fileName:/dataClassesGeneric.kt
CALL 'public final fun <get-x> (): T of <root>.Test1 declared in <root>.Test1' type=T of <root>.Test1 origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test1<T of <root>.Test1> declared in <root>.Test1.copy' type=<root>.Test1<T of <root>.Test1> origin=null
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun copy (x: T of <root>.Test1): <root>.Test1<T of <root>.Test1> declared in <root>.Test1'
CONSTRUCTOR_CALL 'public constructor <init> (x: T of <root>.Test1) [primary] declared in <root>.Test1' type=<root>.Test1<T of <root>.Test1> origin=null
<class: T>: <none>
x: CALL 'public final fun <get-x> (): T of <root>.Test1 declared in <root>.Test1' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test1<T of <root>.Test1> declared in <root>.Test1.copy' type=<root>.Test1<T of <root>.Test1> origin=null
FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.Test1<T of <root>.Test1>, other:kotlin.Any?) returnType:kotlin.Boolean
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.Test1<T of <root>.Test1>
VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any?
@@ -121,6 +126,11 @@ FILE fqName:<root> fileName:/dataClassesGeneric.kt
CALL 'public final fun <get-x> (): T of <root>.Test2 declared in <root>.Test2' type=T of <root>.Test2 origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test2<T of <root>.Test2> declared in <root>.Test2.copy' type=<root>.Test2<T of <root>.Test2> origin=null
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun copy (x: T of <root>.Test2): <root>.Test2<T of <root>.Test2> declared in <root>.Test2'
CONSTRUCTOR_CALL 'public constructor <init> (x: T of <root>.Test2) [primary] declared in <root>.Test2' type=<root>.Test2<T of <root>.Test2> origin=null
<class: T>: <none>
x: CALL 'public final fun <get-x> (): T of <root>.Test2 declared in <root>.Test2' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test2<T of <root>.Test2> declared in <root>.Test2.copy' type=<root>.Test2<T of <root>.Test2> origin=null
FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.Test2<T of <root>.Test2>, other:kotlin.Any?) returnType:kotlin.Boolean
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.Test2<T of <root>.Test2>
VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any?
@@ -202,6 +212,11 @@ FILE fqName:<root> fileName:/dataClassesGeneric.kt
CALL 'public final fun <get-x> (): kotlin.collections.List<T of <root>.Test3> declared in <root>.Test3' type=kotlin.collections.List<T of <root>.Test3> origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test3<T of <root>.Test3> declared in <root>.Test3.copy' type=<root>.Test3<T of <root>.Test3> origin=null
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun copy (x: kotlin.collections.List<T of <root>.Test3>): <root>.Test3<T of <root>.Test3> declared in <root>.Test3'
CONSTRUCTOR_CALL 'public constructor <init> (x: kotlin.collections.List<T of <root>.Test3>) [primary] declared in <root>.Test3' type=<root>.Test3<T of <root>.Test3> origin=null
<class: T>: <none>
x: CALL 'public final fun <get-x> (): kotlin.collections.List<T of <root>.Test3> declared in <root>.Test3' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test3<T of <root>.Test3> declared in <root>.Test3.copy' type=<root>.Test3<T of <root>.Test3> origin=null
FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.Test3<T of <root>.Test3>, other:kotlin.Any?) returnType:kotlin.Boolean
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.Test3<T of <root>.Test3>
VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any?
@@ -282,6 +297,10 @@ FILE fqName:<root> fileName:/dataClassesGeneric.kt
CALL 'public final fun <get-x> (): kotlin.collections.List<kotlin.String> declared in <root>.Test4' type=kotlin.collections.List<kotlin.String> origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test4 declared in <root>.Test4.copy' type=<root>.Test4 origin=null
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun copy (x: kotlin.collections.List<kotlin.String>): <root>.Test4 declared in <root>.Test4'
CONSTRUCTOR_CALL 'public constructor <init> (x: kotlin.collections.List<kotlin.String>) [primary] declared in <root>.Test4' type=<root>.Test4 origin=null
x: CALL 'public final fun <get-x> (): kotlin.collections.List<kotlin.String> declared in <root>.Test4' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test4 declared in <root>.Test4.copy' type=<root>.Test4 origin=null
FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.Test4, other:kotlin.Any?) returnType:kotlin.Boolean
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.Test4
VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any?
+4
View File
@@ -30,6 +30,10 @@ FILE fqName:<root> fileName:/kt31649.kt
CALL 'public final fun <get-nn> (): kotlin.Nothing? declared in <root>.TestData' type=kotlin.Nothing? origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.TestData declared in <root>.TestData.copy' type=<root>.TestData origin=null
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun copy (nn: kotlin.Nothing?): <root>.TestData declared in <root>.TestData'
CONSTRUCTOR_CALL 'public constructor <init> (nn: kotlin.Nothing?) [primary] declared in <root>.TestData' type=<root>.TestData origin=null
nn: CALL 'public final fun <get-nn> (): kotlin.Nothing? declared in <root>.TestData' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.TestData declared in <root>.TestData.copy' type=<root>.TestData origin=null
FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.TestData, other:kotlin.Any?) returnType:kotlin.Boolean
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.TestData
VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any?
@@ -37,6 +37,10 @@ FILE fqName:<root> fileName:/lambdaInDataClassDefaultParameter.kt
CALL 'public final fun <get-runA> (): kotlin.Function2<<root>.A, kotlin.String, kotlin.Unit> declared in <root>.A' type=kotlin.Function2<<root>.A, kotlin.String, kotlin.Unit> origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.A declared in <root>.A.copy' type=<root>.A origin=null
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun copy (runA: kotlin.Function2<<root>.A, kotlin.String, kotlin.Unit>): <root>.A declared in <root>.A'
CONSTRUCTOR_CALL 'public constructor <init> (runA: kotlin.Function2<<root>.A, kotlin.String, kotlin.Unit>) [primary] declared in <root>.A' type=<root>.A origin=null
runA: CALL 'public final fun <get-runA> (): kotlin.Function2<<root>.A, kotlin.String, kotlin.Unit> declared in <root>.A' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.A declared in <root>.A.copy' type=<root>.A origin=null
FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.A, other:kotlin.Any?) returnType:kotlin.Boolean
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.A
VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any?
@@ -139,6 +143,10 @@ FILE fqName:<root> fileName:/lambdaInDataClassDefaultParameter.kt
CALL 'public final fun <get-x> (): kotlin.Any declared in <root>.B' type=kotlin.Any origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.B declared in <root>.B.copy' type=<root>.B origin=null
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun copy (x: kotlin.Any): <root>.B declared in <root>.B'
CONSTRUCTOR_CALL 'public constructor <init> (x: kotlin.Any) [primary] declared in <root>.B' type=<root>.B origin=null
x: CALL 'public final fun <get-x> (): kotlin.Any declared in <root>.B' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.B declared in <root>.B.copy' type=<root>.B origin=null
FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.B, other:kotlin.Any?) returnType:kotlin.Boolean
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.B
VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any?
@@ -55,6 +55,13 @@ FILE fqName:<root> fileName:/dataClassMembers.kt
CALL 'public final fun <get-y> (): kotlin.String declared in <root>.Test' type=kotlin.String origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test<T of <root>.Test> declared in <root>.Test.copy' type=<root>.Test<T of <root>.Test> origin=null
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun copy (x: T of <root>.Test, y: kotlin.String): <root>.Test<T of <root>.Test> declared in <root>.Test'
CONSTRUCTOR_CALL 'public constructor <init> (x: T of <root>.Test, y: kotlin.String) [primary] declared in <root>.Test' type=<root>.Test<T of <root>.Test> origin=null
<class: T>: <none>
x: CALL 'public final fun <get-x> (): T of <root>.Test declared in <root>.Test' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test<T of <root>.Test> declared in <root>.Test.copy' type=<root>.Test<T of <root>.Test> origin=null
y: CALL 'public final fun <get-y> (): kotlin.String declared in <root>.Test' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test<T of <root>.Test> declared in <root>.Test.copy' type=<root>.Test<T of <root>.Test> origin=null
FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.Test<T of <root>.Test>, other:kotlin.Any?) returnType:kotlin.Boolean
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.Test<T of <root>.Test>
VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any?
@@ -52,6 +52,12 @@ FILE fqName:<root> fileName:/destructuringInLambda.kt
CALL 'public final fun <get-y> (): kotlin.Int declared in <root>.A' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.A declared in <root>.A.copy' type=<root>.A origin=null
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun copy (x: kotlin.Int, y: kotlin.Int): <root>.A declared in <root>.A'
CONSTRUCTOR_CALL 'public constructor <init> (x: kotlin.Int, y: kotlin.Int) [primary] declared in <root>.A' type=<root>.A origin=null
x: CALL 'public final fun <get-x> (): kotlin.Int declared in <root>.A' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.A declared in <root>.A.copy' type=<root>.A origin=null
y: CALL 'public final fun <get-y> (): kotlin.Int declared in <root>.A' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.A declared in <root>.A.copy' type=<root>.A origin=null
FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.A, other:kotlin.Any?) returnType:kotlin.Boolean
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.A
VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any?
@@ -167,6 +167,12 @@ FILE fqName:<root> fileName:/enhancedNullabilityInForLoop.kt
CALL 'public final fun <get-y> (): kotlin.Int declared in <root>.P' type=kotlin.Int origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.P declared in <root>.P.copy' type=<root>.P origin=null
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun copy (x: kotlin.Int, y: kotlin.Int): <root>.P declared in <root>.P'
CONSTRUCTOR_CALL 'public constructor <init> (x: kotlin.Int, y: kotlin.Int) [primary] declared in <root>.P' type=<root>.P origin=null
x: CALL 'public final fun <get-x> (): kotlin.Int declared in <root>.P' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.P declared in <root>.P.copy' type=<root>.P origin=null
y: CALL 'public final fun <get-y> (): kotlin.Int declared in <root>.P' type=IrErrorType origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.P declared in <root>.P.copy' type=<root>.P origin=null
FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:<root>.P, other:kotlin.Any?) returnType:kotlin.Boolean
$this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:<this> type:<root>.P
VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name:other index:0 type:kotlin.Any?