FIR: support copy functions in data classes

This commit is contained in:
Mikhail Glukhikh
2019-05-16 11:14:43 +03:00
parent d9261acdfc
commit 2bf80ff64e
17 changed files with 341 additions and 16 deletions
@@ -9,21 +9,24 @@ import org.jetbrains.kotlin.descriptors.Modality
import org.jetbrains.kotlin.descriptors.Visibilities
import org.jetbrains.kotlin.fir.FirFunctionTarget
import org.jetbrains.kotlin.fir.FirSession
import org.jetbrains.kotlin.fir.declarations.FirClass
import org.jetbrains.kotlin.fir.declarations.FirConstructor
import org.jetbrains.kotlin.fir.declarations.FirProperty
import org.jetbrains.kotlin.fir.declarations.FirRegularClass
import org.jetbrains.kotlin.fir.declarations.impl.FirClassImpl
import org.jetbrains.kotlin.fir.declarations.impl.FirMemberFunctionImpl
import org.jetbrains.kotlin.fir.declarations.impl.FirValueParameterImpl
import org.jetbrains.kotlin.fir.expressions.impl.FirFunctionCallImpl
import org.jetbrains.kotlin.fir.expressions.impl.FirQualifiedAccessExpressionImpl
import org.jetbrains.kotlin.fir.expressions.impl.FirReturnExpressionImpl
import org.jetbrains.kotlin.fir.expressions.impl.FirSingleExpressionBlock
import org.jetbrains.kotlin.fir.references.FirResolvedCallableReferenceImpl
import org.jetbrains.kotlin.fir.symbols.CallableId
import org.jetbrains.kotlin.fir.symbols.impl.FirFunctionSymbol
import org.jetbrains.kotlin.fir.types.FirTypeRef
import org.jetbrains.kotlin.fir.types.impl.FirImplicitTypeRefImpl
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.psi.KtClassOrObject
import org.jetbrains.kotlin.psi.KtTypeReference
internal fun KtClassOrObject.generateComponentFunctions(
session: FirSession, firClass: FirClassImpl, packageFqName: FqName, classFqName: FqName
@@ -67,4 +70,64 @@ internal fun KtClassOrObject.generateComponentFunctions(
}
)
}
}
private val copyName = Name.identifier("copy")
internal fun KtClassOrObject.generateCopyFunction(
session: FirSession, firClass: FirClassImpl, packageFqName: FqName, classFqName: FqName,
firPrimaryConstructor: FirConstructor,
toFirOrErrorTypeRef: KtTypeReference?.() -> FirTypeRef
) {
val symbol = FirFunctionSymbol(CallableId(packageFqName, classFqName, copyName))
firClass.addDeclaration(
FirMemberFunctionImpl(
session, this, symbol, copyName,
Visibilities.PUBLIC, Modality.FINAL,
isExpect = false, isActual = false,
isOverride = false, isOperator = false,
isInfix = false, isInline = false,
isTailRec = false, isExternal = false,
isSuspend = false, receiverTypeRef = null,
returnTypeRef = FirImplicitTypeRefImpl(session, this)
).apply {
val copyFunction = this
val zippedParameters =
primaryConstructorParameters.zip(firClass.declarations.filterIsInstance<FirProperty>())
for ((ktParameter, firProperty) in zippedParameters) {
val name = ktParameter.nameAsSafeName
valueParameters += FirValueParameterImpl(
session, ktParameter, name,
ktParameter.typeReference.toFirOrErrorTypeRef(),
FirQualifiedAccessExpressionImpl(session, ktParameter).apply {
calleeReference = FirResolvedCallableReferenceImpl(session, ktParameter, name, firProperty.symbol)
},
isCrossinline = false, isNoinline = false, isVararg = false
)
}
body = FirSingleExpressionBlock(
session,
FirReturnExpressionImpl(
session, this@generateCopyFunction,
FirFunctionCallImpl(session, this@generateCopyFunction).apply {
calleeReference = FirResolvedCallableReferenceImpl(
session, this@generateCopyFunction, firClass.name,
firPrimaryConstructor.symbol
)
}.apply {
for ((ktParameter, firParameter) in primaryConstructorParameters.zip(valueParameters)) {
this.arguments += FirQualifiedAccessExpressionImpl(session, ktParameter).apply {
calleeReference = FirResolvedCallableReferenceImpl(
session, ktParameter, firParameter.name, firParameter.symbol
)
}
}
}
).apply {
target = FirFunctionTarget(null)
target.bind(copyFunction)
}
)
}
)
}
@@ -547,6 +547,10 @@ class RawFirBuilder(val session: FirSession, val stubMode: Boolean) {
if (classOrObject.hasModifier(DATA_KEYWORD) && firPrimaryConstructor != null) {
classOrObject.generateComponentFunctions(session, firClass, packageFqName, className)
classOrObject.generateCopyFunction(session, firClass, packageFqName, className, firPrimaryConstructor) {
toFirOrErrorType()
}
// TODO: equals, hashCode, toString
}
firClass
@@ -29,6 +29,10 @@ FILE: annotated.kt
super<kotlin/Any>()
}
public final fun copy(): <implicit> {
^copy R|/Two.Two|()
}
}
public? final? fun bar(two: Two): kotlin/Unit {
lval <destruct>: <implicit> = two#
@@ -25,6 +25,10 @@ FILE: destructuring.kt
^component3 R|/Some.third|
}
public final fun copy(first: Int = R|/Some.first|, second: Double = R|/Some.second|, third: String = R|/Some.third|): <implicit> {
^copy R|/Some.Some|(R|<local>/first|, R|<local>/second|, R|<local>/third|)
}
}
public? final? fun foo(some: Some): kotlin/Unit {
lval <destruct>: <implicit> = some#
@@ -43,6 +43,10 @@ FILE: for.kt
^component2 R|/Some.y|
}
public final fun copy(x: Int = R|/Some.x|, y: Int = R|/Some.y|): <implicit> {
^copy R|/Some.Some|(R|<local>/x|, R|<local>/y|)
}
}
public? final? fun baz(set: Set<Some>): kotlin/Unit {
lval <range>: <implicit> = set#
@@ -18,6 +18,10 @@ FILE: lambda.kt
^component2 R|/Tuple.y|
}
public final fun copy(x: Int = R|/Tuple.x|, y: Int = R|/Tuple.y|): <implicit> {
^copy R|/Tuple.Tuple|(R|<local>/x|, R|<local>/y|)
}
}
public? final? inline fun use(f: ( (Tuple) -> Int )): <implicit> {
^use f#(Tuple#(Int(1), Int(2)))
@@ -538,6 +538,9 @@ open class FirBodyResolveTransformer(val session: FirSession, val implicitTypeOn
}
override fun transformFunctionCall(functionCall: FirFunctionCall, data: Any?): CompositeTransformResult<FirStatement> {
if (functionCall.calleeReference is FirResolvedCallableReference && functionCall.resultType is FirImplicitTypeRef) {
storeTypeFromCallee(functionCall)
}
if (functionCall.calleeReference !is FirSimpleNamedReference) return functionCall.compose()
val expectedTypeRef = data as FirTypeRef?
val completeInference =
+8
View File
@@ -0,0 +1,8 @@
data class Some(val x: Int, val y: String)
fun test(some: Some) {
val other = some.copy(y = "123")
val another = some.copy(x = 123)
val same = some.copy()
val different = some.copy(456, "456")
}
+31
View File
@@ -0,0 +1,31 @@
FILE: copy.kt
public final data class Some : R|kotlin/Any| {
public constructor(x: R|kotlin/Int|, y: R|kotlin/String|): R|Some| {
super<R|kotlin/Any|>()
}
public final val x: R|kotlin/Int| = R|<local>/x|
public get(): R|kotlin/Int|
public final val y: R|kotlin/String| = R|<local>/y|
public get(): R|kotlin/String|
public final fun component1(): R|kotlin/Int| {
^component1 R|/Some.x|
}
public final fun component2(): R|kotlin/String| {
^component2 R|/Some.y|
}
public final fun copy(x: R|kotlin/Int| = R|/Some.x|, y: R|kotlin/String| = R|/Some.y|): R|Some| {
^copy R|/Some.Some|(R|<local>/x|, R|<local>/y|)
}
}
public final fun test(some: R|Some|): R|kotlin/Unit| {
lval other: R|Some| = R|<local>/some|.R|/Some.copy|(y = String(123))
lval another: R|Some| = R|<local>/some|.R|/Some.copy|(x = Int(123))
lval same: R|Some| = R|<local>/some|.R|/Some.copy|()
lval different: R|Some| = R|<local>/some|.R|/Some.copy|(Int(456), String(456))
}
@@ -18,6 +18,10 @@ FILE: components.kt
^component2 R|/D.y|
}
public final fun copy(x: R|kotlin/Int| = R|/D.x|, y: R|kotlin/String| = R|/D.y|): R|D| {
^copy R|/D.D|(R|<local>/x|, R|<local>/y|)
}
}
public final fun foo(list: R|kotlin/collections/List<D>|): R|kotlin/Unit| {
lval <range>: R|kotlin/collections/List<D>| = R|<local>/list|
@@ -34,6 +34,11 @@ public class FirResolveTestCaseGenerated extends AbstractFirResolveTestCase {
runTest("compiler/fir/resolve/testData/resolve/companion.kt");
}
@TestMetadata("copy.kt")
public void testCopy() throws Exception {
runTest("compiler/fir/resolve/testData/resolve/copy.kt");
}
@TestMetadata("derivedClass.kt")
public void testDerivedClass() throws Exception {
runTest("compiler/fir/resolve/testData/resolve/derivedClass.kt");
@@ -158,7 +158,48 @@ FILE fqName:<root> fileName:/dataClassWithArrayMembers.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component9 (): kotlin.DoubleArray declared in <root>.Test1'
CALL 'public final fun <get-doubleArray> (): kotlin.DoubleArray declared in <root>.Test1' type=kotlin.DoubleArray origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
FUN name:copy visibility:public modality:FINAL <> ($this:<root>.Test1, 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) returnType:<root>.Test1
$this: VALUE_PARAMETER name:<this> type:<root>.Test1
VALUE_PARAMETER name:stringArray index:0 type:kotlin.Array<kotlin.String>
EXPRESSION_BODY
CALL 'public final fun <get-stringArray> (): kotlin.Array<kotlin.String> declared in <root>.Test1' type=kotlin.Array<kotlin.String> origin=null
VALUE_PARAMETER name:charArray index:1 type:kotlin.CharArray
EXPRESSION_BODY
CALL 'public final fun <get-charArray> (): kotlin.CharArray declared in <root>.Test1' type=kotlin.CharArray origin=null
VALUE_PARAMETER name:booleanArray index:2 type:kotlin.BooleanArray
EXPRESSION_BODY
CALL 'public final fun <get-booleanArray> (): kotlin.BooleanArray declared in <root>.Test1' type=kotlin.BooleanArray origin=null
VALUE_PARAMETER name:byteArray index:3 type:kotlin.ByteArray
EXPRESSION_BODY
CALL 'public final fun <get-byteArray> (): kotlin.ByteArray declared in <root>.Test1' type=kotlin.ByteArray origin=null
VALUE_PARAMETER name:shortArray index:4 type:kotlin.ShortArray
EXPRESSION_BODY
CALL 'public final fun <get-shortArray> (): kotlin.ShortArray declared in <root>.Test1' type=kotlin.ShortArray origin=null
VALUE_PARAMETER name:intArray index:5 type:kotlin.IntArray
EXPRESSION_BODY
CALL 'public final fun <get-intArray> (): kotlin.IntArray declared in <root>.Test1' type=kotlin.IntArray origin=null
VALUE_PARAMETER name:longArray index:6 type:kotlin.LongArray
EXPRESSION_BODY
CALL 'public final fun <get-longArray> (): kotlin.LongArray declared in <root>.Test1' type=kotlin.LongArray origin=null
VALUE_PARAMETER name:floatArray index:7 type:kotlin.FloatArray
EXPRESSION_BODY
CALL 'public final fun <get-floatArray> (): kotlin.FloatArray declared in <root>.Test1' type=kotlin.FloatArray origin=null
VALUE_PARAMETER name:doubleArray index:8 type:kotlin.DoubleArray
EXPRESSION_BODY
CALL 'public final fun <get-doubleArray> (): kotlin.DoubleArray declared in <root>.Test1' type=kotlin.DoubleArray 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: GET_VAR 'stringArray: kotlin.Array<kotlin.String> declared in <root>.Test1.copy' type=IrErrorType origin=null
charArray: GET_VAR 'charArray: kotlin.CharArray declared in <root>.Test1.copy' type=IrErrorType origin=null
booleanArray: GET_VAR 'booleanArray: kotlin.BooleanArray declared in <root>.Test1.copy' type=IrErrorType origin=null
byteArray: GET_VAR 'byteArray: kotlin.ByteArray declared in <root>.Test1.copy' type=IrErrorType origin=null
shortArray: GET_VAR 'shortArray: kotlin.ShortArray declared in <root>.Test1.copy' type=IrErrorType origin=null
intArray: GET_VAR 'intArray: kotlin.IntArray declared in <root>.Test1.copy' type=IrErrorType origin=null
longArray: GET_VAR 'longArray: kotlin.LongArray declared in <root>.Test1.copy' type=IrErrorType origin=null
floatArray: GET_VAR 'floatArray: kotlin.FloatArray declared in <root>.Test1.copy' type=IrErrorType origin=null
doubleArray: GET_VAR 'doubleArray: kotlin.DoubleArray declared in <root>.Test1.copy' type=IrErrorType origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
@@ -195,7 +236,17 @@ FILE fqName:<root> fileName:/dataClassWithArrayMembers.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Array<T of <root>.Test2> declared in <root>.Test2'
CALL 'public final fun <get-genericArray> (): kotlin.Array<T of <root>.Test2> declared in <root>.Test2' type=kotlin.Array<T of <root>.Test2> origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
FUN name:copy visibility:public modality:FINAL <> ($this:<root>.Test2, genericArray:kotlin.Array<T of <root>.Test2>) returnType:<root>.Test2<T of <uninitialized parent>>
$this: VALUE_PARAMETER name:<this> type:<root>.Test2
VALUE_PARAMETER name:genericArray index:0 type:kotlin.Array<T of <root>.Test2>
EXPRESSION_BODY
CALL 'public final fun <get-genericArray> (): kotlin.Array<T of <root>.Test2> declared in <root>.Test2' type=kotlin.Array<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 <uninitialized parent>> declared in <root>.Test2'
CONSTRUCTOR_CALL 'public constructor <init> (genericArray: kotlin.Array<T of <uninitialized parent>>) [primary] declared in <root>.Test2' type=<root>.Test2<T of <uninitialized parent>> origin=null
<class: T>: <none>
genericArray: GET_VAR 'genericArray: kotlin.Array<T of <root>.Test2> declared in <root>.Test2.copy' type=IrErrorType origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
@@ -231,7 +282,16 @@ FILE fqName:<root> fileName:/dataClassWithArrayMembers.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Array<kotlin.Any>? declared in <root>.Test3'
CALL 'public final fun <get-anyArrayN> (): kotlin.Array<kotlin.Any>? declared in <root>.Test3' type=kotlin.Array<kotlin.Any>? origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
FUN name:copy visibility:public modality:FINAL <> ($this:<root>.Test3, anyArrayN:kotlin.Array<kotlin.Any>?) returnType:<root>.Test3
$this: VALUE_PARAMETER name:<this> type:<root>.Test3
VALUE_PARAMETER name:anyArrayN index:0 type:kotlin.Array<kotlin.Any>?
EXPRESSION_BODY
CALL 'public final fun <get-anyArrayN> (): kotlin.Array<kotlin.Any>? declared in <root>.Test3' type=kotlin.Array<kotlin.Any>? 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: GET_VAR 'anyArrayN: kotlin.Array<kotlin.Any>? declared in <root>.Test3.copy' type=IrErrorType origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
+50 -3
View File
@@ -56,7 +56,24 @@ FILE fqName:<root> fileName:/dataClasses.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component3 (): kotlin.Any declared in <root>.Test1'
CALL 'public final fun <get-z> (): kotlin.Any declared in <root>.Test1' type=kotlin.Any origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
FUN name:copy visibility:public modality:FINAL <> ($this:<root>.Test1, x:kotlin.Int, y:kotlin.String, z:kotlin.Any) returnType:<root>.Test1
$this: VALUE_PARAMETER name:<this> type:<root>.Test1
VALUE_PARAMETER name:x index:0 type:kotlin.Int
EXPRESSION_BODY
CALL 'public final fun <get-x> (): kotlin.Int declared in <root>.Test1' type=kotlin.Int origin=null
VALUE_PARAMETER name:y index:1 type:kotlin.String
EXPRESSION_BODY
CALL 'public final fun <get-y> (): kotlin.String declared in <root>.Test1' type=kotlin.String origin=null
VALUE_PARAMETER name:z index:2 type:kotlin.Any
EXPRESSION_BODY
CALL 'public final fun <get-z> (): kotlin.Any declared in <root>.Test1' type=kotlin.Any 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: GET_VAR 'x: kotlin.Int declared in <root>.Test1.copy' type=IrErrorType origin=null
y: GET_VAR 'y: kotlin.String declared in <root>.Test1.copy' type=IrErrorType origin=null
z: GET_VAR 'z: kotlin.Any declared in <root>.Test1.copy' type=IrErrorType origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
@@ -92,7 +109,16 @@ FILE fqName:<root> fileName:/dataClasses.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Any? declared in <root>.Test2'
CALL 'public final fun <get-x> (): kotlin.Any? declared in <root>.Test2' type=kotlin.Any? origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
FUN name:copy visibility:public modality:FINAL <> ($this:<root>.Test2, x:kotlin.Any?) returnType:<root>.Test2
$this: VALUE_PARAMETER name:<this> type:<root>.Test2
VALUE_PARAMETER name:x index:0 type:kotlin.Any?
EXPRESSION_BODY
CALL 'public final fun <get-x> (): kotlin.Any? declared in <root>.Test2' type=kotlin.Any? 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: GET_VAR 'x: kotlin.Any? declared in <root>.Test2.copy' type=IrErrorType origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
@@ -179,7 +205,28 @@ FILE fqName:<root> fileName:/dataClasses.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component4 (): kotlin.Float? declared in <root>.Test3'
CALL 'public final fun <get-df> (): kotlin.Float? declared in <root>.Test3' type=kotlin.Float? origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
FUN name:copy visibility:public modality:FINAL <> ($this:<root>.Test3, d:kotlin.Double, dn:kotlin.Double?, f:kotlin.Float, df:kotlin.Float?) returnType:<root>.Test3
$this: VALUE_PARAMETER name:<this> type:<root>.Test3
VALUE_PARAMETER name:d index:0 type:kotlin.Double
EXPRESSION_BODY
CALL 'public final fun <get-d> (): kotlin.Double declared in <root>.Test3' type=kotlin.Double origin=null
VALUE_PARAMETER name:dn index:1 type:kotlin.Double?
EXPRESSION_BODY
CALL 'public final fun <get-dn> (): kotlin.Double? declared in <root>.Test3' type=kotlin.Double? origin=null
VALUE_PARAMETER name:f index:2 type:kotlin.Float
EXPRESSION_BODY
CALL 'public final fun <get-f> (): kotlin.Float declared in <root>.Test3' type=kotlin.Float origin=null
VALUE_PARAMETER name:df index:3 type:kotlin.Float?
EXPRESSION_BODY
CALL 'public final fun <get-df> (): kotlin.Float? declared in <root>.Test3' type=kotlin.Float? 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: GET_VAR 'd: kotlin.Double declared in <root>.Test3.copy' type=IrErrorType origin=null
dn: GET_VAR 'dn: kotlin.Double? declared in <root>.Test3.copy' type=IrErrorType origin=null
f: GET_VAR 'f: kotlin.Float declared in <root>.Test3.copy' type=IrErrorType origin=null
df: GET_VAR 'df: kotlin.Float? declared in <root>.Test3.copy' type=IrErrorType origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
@@ -23,7 +23,17 @@ FILE fqName:<root> fileName:/dataClassesGeneric.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component1 (): T of <root>.Test1 declared in <root>.Test1'
CALL 'public final fun <get-x> (): T of <root>.Test1 declared in <root>.Test1' type=T of <root>.Test1 origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
FUN name:copy visibility:public modality:FINAL <> ($this:<root>.Test1, x:T of <root>.Test1) returnType:<root>.Test1<T of <uninitialized parent>>
$this: VALUE_PARAMETER name:<this> type:<root>.Test1
VALUE_PARAMETER name:x index:0 type:T of <root>.Test1
EXPRESSION_BODY
CALL 'public final fun <get-x> (): T of <root>.Test1 declared in <root>.Test1' type=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 <uninitialized parent>> declared in <root>.Test1'
CONSTRUCTOR_CALL 'public constructor <init> (x: T of <uninitialized parent>) [primary] declared in <root>.Test1' type=<root>.Test1<T of <uninitialized parent>> origin=null
<class: T>: <none>
x: GET_VAR 'x: T of <root>.Test1 declared in <root>.Test1.copy' type=IrErrorType origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
@@ -60,7 +70,17 @@ FILE fqName:<root> fileName:/dataClassesGeneric.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component1 (): T of <root>.Test2 declared in <root>.Test2'
CALL 'public final fun <get-x> (): T of <root>.Test2 declared in <root>.Test2' type=T of <root>.Test2 origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
FUN name:copy visibility:public modality:FINAL <> ($this:<root>.Test2, x:T of <root>.Test2) returnType:<root>.Test2<T of <uninitialized parent>>
$this: VALUE_PARAMETER name:<this> type:<root>.Test2
VALUE_PARAMETER name:x index:0 type:T of <root>.Test2
EXPRESSION_BODY
CALL 'public final fun <get-x> (): T of <root>.Test2 declared in <root>.Test2' type=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 <uninitialized parent>> declared in <root>.Test2'
CONSTRUCTOR_CALL 'public constructor <init> (x: T of <uninitialized parent>) [primary] declared in <root>.Test2' type=<root>.Test2<T of <uninitialized parent>> origin=null
<class: T>: <none>
x: GET_VAR 'x: T of <root>.Test2 declared in <root>.Test2.copy' type=IrErrorType origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
@@ -97,7 +117,17 @@ FILE fqName:<root> fileName:/dataClassesGeneric.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.collections.List<T of <root>.Test3> declared in <root>.Test3'
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=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
FUN name:copy visibility:public modality:FINAL <> ($this:<root>.Test3, x:kotlin.collections.List<T of <root>.Test3>) returnType:<root>.Test3<T of <uninitialized parent>>
$this: VALUE_PARAMETER name:<this> type:<root>.Test3
VALUE_PARAMETER name:x index:0 type:kotlin.collections.List<T of <root>.Test3>
EXPRESSION_BODY
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=null
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun copy (x: kotlin.collections.List<T of <root>.Test3>): <root>.Test3<T of <uninitialized parent>> declared in <root>.Test3'
CONSTRUCTOR_CALL 'public constructor <init> (x: kotlin.collections.List<T of <uninitialized parent>>) [primary] declared in <root>.Test3' type=<root>.Test3<T of <uninitialized parent>> origin=null
<class: T>: <none>
x: GET_VAR 'x: kotlin.collections.List<T of <root>.Test3> declared in <root>.Test3.copy' type=IrErrorType origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
@@ -133,7 +163,16 @@ FILE fqName:<root> fileName:/dataClassesGeneric.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.collections.List<kotlin.String> declared in <root>.Test4'
CALL 'public final fun <get-x> (): kotlin.collections.List<kotlin.String> declared in <root>.Test4' type=kotlin.collections.List<kotlin.String> origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
FUN name:copy visibility:public modality:FINAL <> ($this:<root>.Test4, x:kotlin.collections.List<kotlin.String>) returnType:<root>.Test4
$this: VALUE_PARAMETER name:<this> type:<root>.Test4
VALUE_PARAMETER name:x index:0 type:kotlin.collections.List<kotlin.String>
EXPRESSION_BODY
CALL 'public final fun <get-x> (): kotlin.collections.List<kotlin.String> declared in <root>.Test4' type=kotlin.collections.List<kotlin.String> 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: GET_VAR 'x: kotlin.collections.List<kotlin.String> declared in <root>.Test4.copy' type=IrErrorType origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
@@ -28,7 +28,16 @@ FILE fqName:<root> fileName:/lambdaInDataClassDefaultParameter.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Function2<<root>.A, kotlin.String, kotlin.Unit> declared in <root>.A'
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=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
FUN name:copy visibility:public modality:FINAL <> ($this:<root>.A, runA:kotlin.Function2<<root>.A, kotlin.String, kotlin.Unit>) returnType:<root>.A
$this: VALUE_PARAMETER name:<this> type:<root>.A
VALUE_PARAMETER name:runA index:0 type:kotlin.Function2<<root>.A, kotlin.String, kotlin.Unit>
EXPRESSION_BODY
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=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: GET_VAR 'runA: kotlin.Function2<<root>.A, kotlin.String, kotlin.Unit> declared in <root>.A.copy' type=IrErrorType origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
@@ -73,7 +82,16 @@ FILE fqName:<root> fileName:/lambdaInDataClassDefaultParameter.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Any declared in <root>.B'
CALL 'public final fun <get-x> (): kotlin.Any declared in <root>.B' type=kotlin.Any origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
FUN name:copy visibility:public modality:FINAL <> ($this:<root>.B, x:kotlin.Any) returnType:<root>.B
$this: VALUE_PARAMETER name:<this> type:<root>.B
VALUE_PARAMETER name:x index:0 type:kotlin.Any
EXPRESSION_BODY
CALL 'public final fun <get-x> (): kotlin.Any declared in <root>.B' type=kotlin.Any 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: GET_VAR 'x: kotlin.Any declared in <root>.B.copy' type=IrErrorType origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
@@ -42,7 +42,21 @@ FILE fqName:<root> fileName:/dataClassMembers.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component2 (): kotlin.String declared in <root>.Test'
CALL 'public final fun <get-y> (): kotlin.String declared in <root>.Test' type=kotlin.String origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
FUN name:copy visibility:public modality:FINAL <> ($this:<root>.Test, x:T of <root>.Test, y:kotlin.String) returnType:<root>.Test<T of <uninitialized parent>>
$this: VALUE_PARAMETER name:<this> type:<root>.Test
VALUE_PARAMETER name:x index:0 type:T of <root>.Test
EXPRESSION_BODY
CALL 'public final fun <get-x> (): T of <root>.Test declared in <root>.Test' type=T of <root>.Test origin=null
VALUE_PARAMETER name:y index:1 type:kotlin.String
EXPRESSION_BODY
CALL 'public final fun <get-y> (): kotlin.String declared in <root>.Test' type=kotlin.String 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 <uninitialized parent>> declared in <root>.Test'
CONSTRUCTOR_CALL 'public constructor <init> (x: T of <uninitialized parent>, y: kotlin.String) [primary] declared in <root>.Test' type=<root>.Test<T of <uninitialized parent>> origin=null
<class: T>: <none>
x: GET_VAR 'x: T of <root>.Test declared in <root>.Test.copy' type=IrErrorType origin=null
y: GET_VAR 'y: kotlin.String declared in <root>.Test.copy' type=IrErrorType origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
@@ -39,7 +39,20 @@ FILE fqName:<root> fileName:/destructuringInLambda.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component2 (): kotlin.Int declared in <root>.A'
CALL 'public final fun <get-y> (): kotlin.Int declared in <root>.A' type=kotlin.Int origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
FUN name:copy visibility:public modality:FINAL <> ($this:<root>.A, x:kotlin.Int, y:kotlin.Int) returnType:<root>.A
$this: VALUE_PARAMETER name:<this> type:<root>.A
VALUE_PARAMETER name:x index:0 type:kotlin.Int
EXPRESSION_BODY
CALL 'public final fun <get-x> (): kotlin.Int declared in <root>.A' type=kotlin.Int origin=null
VALUE_PARAMETER name:y index:1 type:kotlin.Int
EXPRESSION_BODY
CALL 'public final fun <get-y> (): kotlin.Int declared in <root>.A' type=kotlin.Int 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: GET_VAR 'x: kotlin.Int declared in <root>.A.copy' type=IrErrorType origin=null
y: GET_VAR 'y: kotlin.Int declared in <root>.A.copy' type=IrErrorType origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any