diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/DataClassMembersGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/DataClassMembersGenerator.kt index fd2976dc29d..8c21756723a 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/DataClassMembersGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/DataClassMembersGenerator.kt @@ -275,7 +275,7 @@ class DataClassMembersGenerator( private fun MemberFunctionBuilder.getHashCodeOf(kotlinType: KotlinType, irValue: IrExpression): IrExpression { val hashCodeFunctionDescriptor = getHashCodeFunction(kotlinType) val hashCodeFunctionSymbol = declarationGenerator.context.symbolTable.referenceFunction(hashCodeFunctionDescriptor.original) - return irCall(hashCodeFunctionSymbol, hashCodeFunctionDescriptor, context.irBuiltIns.intType).apply { + return irCall(hashCodeFunctionSymbol, context.irBuiltIns.intType).apply { if (descriptor.dispatchReceiverParameter != null) { dispatchReceiver = irValue } else { diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/LocalClassGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/LocalClassGenerator.kt index 1c77f050802..d52f76cb145 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/LocalClassGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/LocalClassGenerator.kt @@ -19,7 +19,7 @@ package org.jetbrains.kotlin.psi2ir.generators import org.jetbrains.kotlin.ir.IrStatement import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.expressions.impl.IrBlockImpl -import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl +import org.jetbrains.kotlin.ir.expressions.impl.IrConstructorCallImpl import org.jetbrains.kotlin.psi.KtClassOrObject import org.jetbrains.kotlin.psi.KtObjectLiteralExpression import org.jetbrains.kotlin.psi.psiUtil.endOffset @@ -36,7 +36,7 @@ class LocalClassGenerator(statementGenerator: StatementGenerator) : StatementGen irBlock.statements.add(irClass) val objectConstructor = irClass.descriptor.unsubstitutedPrimaryConstructor - ?: throw AssertionError("Object literal should have a primary constructor: ${irClass.descriptor}") + ?: throw AssertionError("Object literal should have a primary constructor: ${irClass.descriptor}") assert(objectConstructor.dispatchReceiverParameter == null) { "Object literal constructor should have no dispatch receiver parameter: $objectConstructor" } @@ -48,10 +48,9 @@ class LocalClassGenerator(statementGenerator: StatementGenerator) : StatementGen } irBlock.statements.add( - IrCallImpl( + IrConstructorCallImpl.fromSymbolDescriptor( startOffset, endOffset, objectLiteralType, context.symbolTable.referenceConstructor(objectConstructor), - objectConstructor, IrStatementOrigin.OBJECT_LITERAL ) ) diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/builders/ExpressionHelpers.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/builders/ExpressionHelpers.kt index eda0edd1e6c..317a7e7f680 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/builders/ExpressionHelpers.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/builders/ExpressionHelpers.kt @@ -203,7 +203,8 @@ fun IrBuilderWithScope.irGet(type: IrType, receiver: IrExpression?, getterSymbol IrGetterCallImpl( startOffset, endOffset, type, - getterSymbol, getterSymbol.descriptor, + getterSymbol as IrSimpleFunctionSymbol, + getterSymbol.descriptor, typeArgumentsCount = 0, dispatchReceiver = receiver, extensionReceiver = null, @@ -214,7 +215,8 @@ fun IrBuilderWithScope.irSet(type: IrType, receiver: IrExpression?, getterSymbol IrSetterCallImpl( startOffset, endOffset, type, - getterSymbol, getterSymbol.descriptor, + getterSymbol as IrSimpleFunctionSymbol, + getterSymbol.descriptor, typeArgumentsCount = 0, dispatchReceiver = receiver, extensionReceiver = null, @@ -222,42 +224,72 @@ fun IrBuilderWithScope.irSet(type: IrType, receiver: IrExpression?, getterSymbol origin = IrStatementOrigin.EQ ) -fun IrBuilderWithScope.irCall(callee: IrFunctionSymbol, type: IrType, typeArguments: List = emptyList()): IrCall = - IrCallImpl(startOffset, endOffset, type, callee, callee.descriptor).apply { +fun IrBuilderWithScope.irCall( + callee: IrFunctionSymbol, + type: IrType, + typeArguments: List +): IrMemberAccessExpression = + irCall(callee, type).apply { typeArguments.forEachIndexed { index, irType -> this.putTypeArgument(index, irType) } } fun IrBuilderWithScope.irCallConstructor(callee: IrConstructorSymbol, typeArguments: List): IrCall = - IrCallImpl(startOffset, endOffset, callee.owner.returnType, callee, callee.descriptor, typeArguments.size, callee.owner.valueParameters.size).apply { - typeArguments.forEachIndexed { index, irType -> - this.putTypeArgument(index, irType) - } + TODO("IrConstructorCall") +// IrCallImpl(startOffset, endOffset, callee.owner.returnType, callee, callee.descriptor, typeArguments.size, callee.owner.valueParameters.size).apply { +// typeArguments.forEachIndexed { index, irType -> +// this.putTypeArgument(index, irType) +// } +// } + +fun IrBuilderWithScope.irCall(callee: IrSimpleFunctionSymbol, type: IrType): IrCall = + IrCallImpl(startOffset, endOffset, type, callee, callee.descriptor) + +fun IrBuilderWithScope.irCall(callee: IrConstructorSymbol, type: IrType): IrConstructorCall = + IrConstructorCallImpl.fromSymbolDescriptor(startOffset, endOffset, type, callee) + +fun IrBuilderWithScope.irCall(callee: IrFunctionSymbol, type: IrType): IrMemberAccessExpression = + when (callee) { + is IrConstructorSymbol -> irCall(callee, type) + is IrSimpleFunctionSymbol -> irCall(callee, type) + else -> throw AssertionError("Unexpected callee: $callee") } -fun IrBuilderWithScope.irCall(callee: IrFunctionSymbol): IrCall = - IrCallImpl(startOffset, endOffset, callee.owner.returnType, callee, callee.descriptor) +fun IrBuilderWithScope.irCall(callee: IrSimpleFunctionSymbol): IrCall = + irCall(callee, callee.owner.returnType) + +fun IrBuilderWithScope.irCall(callee: IrConstructorSymbol): IrConstructorCall = + irCall(callee, callee.owner.returnType) + +fun IrBuilderWithScope.irCall(callee: IrFunctionSymbol): IrMemberAccessExpression = + irCall(callee, callee.owner.returnType) fun IrBuilderWithScope.irCall(callee: IrFunctionSymbol, descriptor: FunctionDescriptor, type: IrType): IrCall = - IrCallImpl(startOffset, endOffset, type, callee, descriptor) + IrCallImpl(startOffset, endOffset, type, callee as IrSimpleFunctionSymbol, descriptor) -fun IrBuilderWithScope.irCall(callee: IrFunction): IrCall = - irCall(callee.symbol, callee.descriptor, callee.returnType) +fun IrBuilderWithScope.irCall(callee: IrFunction): IrMemberAccessExpression = + irCall(callee.symbol) fun IrBuilderWithScope.irCall(callee: IrFunction, origin: IrStatementOrigin): IrCall = - IrCallImpl(startOffset, endOffset, callee.returnType, callee.symbol, callee.descriptor, origin) + IrCallImpl( + startOffset, endOffset, callee.returnType, + callee.symbol as IrSimpleFunctionSymbol, + callee.descriptor, origin + ) fun IrBuilderWithScope.irDelegatingConstructorCall(callee: IrConstructor): IrDelegatingConstructorCall = - IrDelegatingConstructorCallImpl(startOffset, endOffset, callee.returnType, callee.symbol, callee.descriptor, - callee.parentAsClass.typeParameters.size, callee.valueParameters.size) + IrDelegatingConstructorCallImpl( + startOffset, endOffset, callee.returnType, callee.symbol, callee.descriptor, + callee.parentAsClass.typeParameters.size, callee.valueParameters.size + ) fun IrBuilderWithScope.irCallOp( callee: IrFunctionSymbol, type: IrType, dispatchReceiver: IrExpression, argument: IrExpression? = null -): IrCall = +): IrMemberAccessExpression = irCall(callee, type).apply { this.dispatchReceiver = dispatchReceiver if (argument != null) diff --git a/compiler/testData/ir/irText/classes/dataClassWithArrayMembers.txt b/compiler/testData/ir/irText/classes/dataClassWithArrayMembers.txt index cb57101bcc1..6fc3530158a 100644 --- a/compiler/testData/ir/irText/classes/dataClassWithArrayMembers.txt +++ b/compiler/testData/ir/irText/classes/dataClassWithArrayMembers.txt @@ -207,7 +207,7 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt $this: GET_VAR ': .Test1 declared in .Test1.copy' type=.Test1 origin=null BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun copy (stringArray: kotlin.Array, charArray: kotlin.CharArray, booleanArray: kotlin.BooleanArray, byteArray: kotlin.ByteArray, shortArray: kotlin.ShortArray, intArray: kotlin.IntArray, longArray: kotlin.LongArray, floatArray: kotlin.FloatArray, doubleArray: kotlin.DoubleArray): .Test1 declared in .Test1' - CALL 'public constructor (stringArray: kotlin.Array, 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 .Test1' type=.Test1 origin=null + CONSTRUCTOR_CALL 'public constructor (stringArray: kotlin.Array, 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 .Test1' type=.Test1 origin=null stringArray: GET_VAR 'stringArray: kotlin.Array declared in .Test1.copy' type=kotlin.Array origin=null charArray: GET_VAR 'charArray: kotlin.CharArray declared in .Test1.copy' type=kotlin.CharArray origin=null booleanArray: GET_VAR 'booleanArray: kotlin.BooleanArray declared in .Test1.copy' type=kotlin.BooleanArray origin=null @@ -494,8 +494,8 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt $this: GET_VAR ': .Test2.Test2> declared in .Test2.copy' type=.Test2.Test2> origin=null BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun copy (genericArray: kotlin.Array.Test2>): .Test2.Test2> declared in .Test2' - CALL 'public constructor (genericArray: kotlin.Array.Test2>) [primary] declared in .Test2' type=.Test2.Test2> origin=null - : T of .Test2 + CONSTRUCTOR_CALL 'public constructor (genericArray: kotlin.Array.Test2>) [primary] declared in .Test2' type=.Test2.Test2> origin=null + : T of .Test2 genericArray: GET_VAR 'genericArray: kotlin.Array.Test2> declared in .Test2.copy' type=kotlin.Array.Test2> origin=null FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test2.Test2>) returnType:kotlin.String overridden: @@ -589,7 +589,7 @@ FILE fqName: fileName:/dataClassWithArrayMembers.kt $this: GET_VAR ': .Test3 declared in .Test3.copy' type=.Test3 origin=null BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun copy (anyArrayN: kotlin.Array?): .Test3 declared in .Test3' - CALL 'public constructor (anyArrayN: kotlin.Array?) [primary] declared in .Test3' type=.Test3 origin=null + CONSTRUCTOR_CALL 'public constructor (anyArrayN: kotlin.Array?) [primary] declared in .Test3' type=.Test3 origin=null anyArrayN: GET_VAR 'anyArrayN: kotlin.Array? declared in .Test3.copy' type=kotlin.Array? origin=null FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test3) returnType:kotlin.String overridden: diff --git a/compiler/testData/ir/irText/classes/dataClasses.txt b/compiler/testData/ir/irText/classes/dataClasses.txt index fce1def113e..a799e4f8c6d 100644 --- a/compiler/testData/ir/irText/classes/dataClasses.txt +++ b/compiler/testData/ir/irText/classes/dataClasses.txt @@ -75,7 +75,7 @@ FILE fqName: fileName:/dataClasses.kt $this: GET_VAR ': .Test1 declared in .Test1.copy' type=.Test1 origin=null BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun copy (x: kotlin.Int, y: kotlin.String, z: kotlin.Any): .Test1 declared in .Test1' - CALL 'public constructor (x: kotlin.Int, y: kotlin.String, z: kotlin.Any) [primary] declared in .Test1' type=.Test1 origin=null + CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int, y: kotlin.String, z: kotlin.Any) [primary] declared in .Test1' type=.Test1 origin=null x: GET_VAR 'x: kotlin.Int declared in .Test1.copy' type=kotlin.Int origin=null y: GET_VAR 'y: kotlin.String declared in .Test1.copy' type=kotlin.String origin=null z: GET_VAR 'z: kotlin.Any declared in .Test1.copy' type=kotlin.Any origin=null @@ -214,7 +214,7 @@ FILE fqName: fileName:/dataClasses.kt $this: GET_VAR ': .Test2 declared in .Test2.copy' type=.Test2 origin=null BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun copy (x: kotlin.Any?): .Test2 declared in .Test2' - CALL 'public constructor (x: kotlin.Any?) [primary] declared in .Test2' type=.Test2 origin=null + CONSTRUCTOR_CALL 'public constructor (x: kotlin.Any?) [primary] declared in .Test2' type=.Test2 origin=null x: GET_VAR 'x: kotlin.Any? declared in .Test2.copy' type=kotlin.Any? origin=null FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test2) returnType:kotlin.String overridden: @@ -384,7 +384,7 @@ FILE fqName: fileName:/dataClasses.kt $this: GET_VAR ': .Test3 declared in .Test3.copy' type=.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?): .Test3 declared in .Test3' - CALL 'public constructor (d: kotlin.Double, dn: kotlin.Double?, f: kotlin.Float, df: kotlin.Float?) [primary] declared in .Test3' type=.Test3 origin=null + CONSTRUCTOR_CALL 'public constructor (d: kotlin.Double, dn: kotlin.Double?, f: kotlin.Float, df: kotlin.Float?) [primary] declared in .Test3' type=.Test3 origin=null d: GET_VAR 'd: kotlin.Double declared in .Test3.copy' type=kotlin.Double origin=null dn: GET_VAR 'dn: kotlin.Double? declared in .Test3.copy' type=kotlin.Double? origin=null f: GET_VAR 'f: kotlin.Float declared in .Test3.copy' type=kotlin.Float origin=null diff --git a/compiler/testData/ir/irText/classes/dataClassesGeneric.txt b/compiler/testData/ir/irText/classes/dataClassesGeneric.txt index 315264a9fbb..21366b56591 100644 --- a/compiler/testData/ir/irText/classes/dataClassesGeneric.txt +++ b/compiler/testData/ir/irText/classes/dataClassesGeneric.txt @@ -32,8 +32,8 @@ FILE fqName: fileName:/dataClassesGeneric.kt $this: GET_VAR ': .Test1.Test1> declared in .Test1.copy' type=.Test1.Test1> origin=null BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun copy (x: T of .Test1): .Test1.Test1> declared in .Test1' - CALL 'public constructor (x: T of .Test1) [primary] declared in .Test1' type=.Test1.Test1> origin=null - : T of .Test1 + CONSTRUCTOR_CALL 'public constructor (x: T of .Test1) [primary] declared in .Test1' type=.Test1.Test1> origin=null + : T of .Test1 x: GET_VAR 'x: T of .Test1 declared in .Test1.copy' type=T of .Test1 origin=null FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test1.Test1>) returnType:kotlin.String overridden: @@ -138,8 +138,8 @@ FILE fqName: fileName:/dataClassesGeneric.kt $this: GET_VAR ': .Test2.Test2> declared in .Test2.copy' type=.Test2.Test2> origin=null BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun copy (x: T of .Test2): .Test2.Test2> declared in .Test2' - CALL 'public constructor (x: T of .Test2) [primary] declared in .Test2' type=.Test2.Test2> origin=null - : T of .Test2 + CONSTRUCTOR_CALL 'public constructor (x: T of .Test2) [primary] declared in .Test2' type=.Test2.Test2> origin=null + : T of .Test2 x: GET_VAR 'x: T of .Test2 declared in .Test2.copy' type=T of .Test2 origin=null FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test2.Test2>) returnType:kotlin.String overridden: @@ -233,8 +233,8 @@ FILE fqName: fileName:/dataClassesGeneric.kt $this: GET_VAR ': .Test3.Test3> declared in .Test3.copy' type=.Test3.Test3> origin=null BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun copy (x: kotlin.collections.List.Test3>): .Test3.Test3> declared in .Test3' - CALL 'public constructor (x: kotlin.collections.List.Test3>) [primary] declared in .Test3' type=.Test3.Test3> origin=null - : T of .Test3 + CONSTRUCTOR_CALL 'public constructor (x: kotlin.collections.List.Test3>) [primary] declared in .Test3' type=.Test3.Test3> origin=null + : T of .Test3 x: GET_VAR 'x: kotlin.collections.List.Test3> declared in .Test3.copy' type=kotlin.collections.List.Test3> origin=null FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test3.Test3>) returnType:kotlin.String overridden: @@ -327,7 +327,7 @@ FILE fqName: fileName:/dataClassesGeneric.kt $this: GET_VAR ': .Test4 declared in .Test4.copy' type=.Test4 origin=null BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun copy (x: kotlin.collections.List): .Test4 declared in .Test4' - CALL 'public constructor (x: kotlin.collections.List) [primary] declared in .Test4' type=.Test4 origin=null + CONSTRUCTOR_CALL 'public constructor (x: kotlin.collections.List) [primary] declared in .Test4' type=.Test4 origin=null x: GET_VAR 'x: kotlin.collections.List declared in .Test4.copy' type=kotlin.collections.List origin=null FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test4) returnType:kotlin.String overridden: diff --git a/compiler/testData/ir/irText/classes/delegatedImplementation.txt b/compiler/testData/ir/irText/classes/delegatedImplementation.txt index 52ab2ecf4b2..f41aab86892 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementation.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementation.txt @@ -193,7 +193,7 @@ FILE fqName: fileName:/delegatedImplementation.kt overridden: public open fun toString (): kotlin.String declared in .IOther $this: VALUE_PARAMETER name: type:kotlin.Any - CALL 'public constructor () [primary] declared in .otherImpl.' type=.otherImpl. origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .otherImpl.' type=.otherImpl. origin=OBJECT_LITERAL CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.IBase] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 CONSTRUCTOR visibility:public <> () returnType:.Test1 [primary] diff --git a/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.txt b/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.txt index 3c7f2541577..b8fcf63faae 100644 --- a/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.txt +++ b/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.txt @@ -40,7 +40,7 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt $this: GET_VAR ': .A declared in .A.copy' type=.A origin=null BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun copy (runA: @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit>): .A declared in .A' - CALL 'public constructor (runA: @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit>) [primary] declared in .A' type=.A origin=null + CONSTRUCTOR_CALL 'public constructor (runA: @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit>) [primary] declared in .A' type=.A origin=null runA: GET_VAR 'runA: @[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> declared in .A.copy' type=@[ExtensionFunctionType] kotlin.Function2<.A, kotlin.String, kotlin.Unit> origin=null FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.String overridden: @@ -126,7 +126,7 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CALL 'public constructor () [primary] declared in .B..' type=.B.. origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .B..' type=.B.. origin=OBJECT_LITERAL BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' @@ -155,7 +155,7 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt $this: GET_VAR ': .B declared in .B.copy' type=.B origin=null BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun copy (x: kotlin.Any): .B declared in .B' - CALL 'public constructor (x: kotlin.Any) [primary] declared in .B' type=.B origin=null + CONSTRUCTOR_CALL 'public constructor (x: kotlin.Any) [primary] declared in .B' type=.B origin=null x: GET_VAR 'x: kotlin.Any declared in .B.copy' type=kotlin.Any origin=null FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.B) returnType:kotlin.String overridden: diff --git a/compiler/testData/ir/irText/classes/objectLiteralExpressions.txt b/compiler/testData/ir/irText/classes/objectLiteralExpressions.txt index ae4a41b4c60..b91aed79046 100644 --- a/compiler/testData/ir/irText/classes/objectLiteralExpressions.txt +++ b/compiler/testData/ir/irText/classes/objectLiteralExpressions.txt @@ -39,7 +39,7 @@ FILE fqName: fileName:/objectLiteralExpressions.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CALL 'public constructor () [primary] declared in .test1.' type=.test1. origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .test1.' type=.test1. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Any correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] BLOCK_BODY @@ -75,7 +75,7 @@ FILE fqName: fileName:/objectLiteralExpressions.kt overridden: public open fun toString (): kotlin.String declared in .IFoo $this: VALUE_PARAMETER name: type:kotlin.Any - CALL 'public constructor () [primary] declared in .test2.' type=.test2. origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .test2.' type=.test2. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.IFoo correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] BLOCK_BODY @@ -143,7 +143,7 @@ FILE fqName: fileName:/objectLiteralExpressions.kt overridden: public open fun toString (): kotlin.String declared in .Outer.Inner $this: VALUE_PARAMETER name: type:kotlin.Any - CALL 'public constructor () [primary] declared in .Outer.test3.' type=.Outer.test3. origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Outer.test3.' type=.Outer.test3. origin=OBJECT_LITERAL 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 @@ -189,4 +189,4 @@ FILE fqName: fileName:/objectLiteralExpressions.kt overridden: public open fun toString (): kotlin.String declared in .Outer.Inner $this: VALUE_PARAMETER name: type:kotlin.Any - CALL 'public constructor () [primary] declared in .test4.' type=.test4. origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .test4.' type=.test4. origin=OBJECT_LITERAL diff --git a/compiler/testData/ir/irText/declarations/annotations/classLiteralInAnnotation.txt b/compiler/testData/ir/irText/declarations/annotations/classLiteralInAnnotation.txt index 36b0e4d56e8..3aa3f7cbba0 100644 --- a/compiler/testData/ir/irText/declarations/annotations/classLiteralInAnnotation.txt +++ b/compiler/testData/ir/irText/declarations/annotations/classLiteralInAnnotation.txt @@ -76,7 +76,7 @@ FILE fqName: fileName:/classLiteralInAnnotation.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CALL 'public constructor () [primary] declared in .test2.' type=.test2..test2> origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .test2.' type=.test2..test2> origin=OBJECT_LITERAL PROPERTY name:test3 visibility:public modality:FINAL [var] FUN name: visibility:public modality:FINAL ($receiver:T of .) returnType:kotlin.Any [inline] correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [var] @@ -106,7 +106,7 @@ FILE fqName: fileName:/classLiteralInAnnotation.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CALL 'public constructor () [primary] declared in ..' type=.. origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in ..' type=.. origin=OBJECT_LITERAL FUN name: visibility:public modality:FINAL ($receiver:T of ., v:kotlin.Any) returnType:kotlin.Unit [inline] correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [var] TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] @@ -136,4 +136,4 @@ FILE fqName: fileName:/classLiteralInAnnotation.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CALL 'public constructor () [primary] declared in ..' type=.. origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in ..' type=.. origin=OBJECT_LITERAL diff --git a/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.txt b/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.txt index 2f30c5dca93..2bede13d96c 100644 --- a/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.txt +++ b/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.txt @@ -56,8 +56,8 @@ FILE fqName: fileName:/dataClassMembers.kt $this: GET_VAR ': .Test.Test> declared in .Test.copy' type=.Test.Test> origin=null BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun copy (x: T of .Test, y: kotlin.String): .Test.Test> declared in .Test' - CALL 'public constructor (x: T of .Test, y: kotlin.String) [primary] declared in .Test' type=.Test.Test> origin=null - : T of .Test + CONSTRUCTOR_CALL 'public constructor (x: T of .Test, y: kotlin.String) [primary] declared in .Test' type=.Test.Test> origin=null + : T of .Test x: GET_VAR 'x: T of .Test declared in .Test.copy' type=T of .Test origin=null y: GET_VAR 'y: kotlin.String declared in .Test.copy' type=kotlin.String origin=null FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test.Test>) returnType:kotlin.String diff --git a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.txt b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.txt index 4c0c10087b4..0e31d1e3f41 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.txt +++ b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.txt @@ -103,7 +103,7 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CALL 'public constructor () [primary] declared in .MyEnum.Z.anObject.' type=.MyEnum.Z.anObject. origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .MyEnum.Z.anObject.' type=.MyEnum.Z.anObject. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.MyEnum.Z) returnType:kotlin.Any correspondingProperty: PROPERTY name:anObject visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.MyEnum.Z diff --git a/compiler/testData/ir/irText/expressions/multipleThisReferences.txt b/compiler/testData/ir/irText/expressions/multipleThisReferences.txt index 882f9987e3b..9798fe1605e 100644 --- a/compiler/testData/ir/irText/expressions/multipleThisReferences.txt +++ b/compiler/testData/ir/irText/expressions/multipleThisReferences.txt @@ -119,7 +119,7 @@ FILE fqName: fileName:/multipleThisReferences.kt overridden: public open fun toString (): kotlin.String declared in .Outer.Inner $this: VALUE_PARAMETER name: type:kotlin.Any - CALL 'public constructor () [primary] declared in .Host.test.' type=.Host.test. origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Host.test.' type=.Host.test. origin=OBJECT_LITERAL 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 diff --git a/compiler/testData/ir/irText/expressions/objectReference.txt b/compiler/testData/ir/irText/expressions/objectReference.txt index 44ec5294e52..8c1ac5f6b06 100644 --- a/compiler/testData/ir/irText/expressions/objectReference.txt +++ b/compiler/testData/ir/irText/expressions/objectReference.txt @@ -157,7 +157,7 @@ FILE fqName: fileName:/objectReference.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CALL 'public constructor () [primary] declared in .Z.anObject.' type=.Z.anObject. origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Z.anObject.' type=.Z.anObject. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Z) returnType:kotlin.Any correspondingProperty: PROPERTY name:anObject visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.Z diff --git a/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.txt b/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.txt index 8198b5628f4..0af376adeda 100644 --- a/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.txt +++ b/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.txt @@ -110,4 +110,4 @@ FILE fqName: fileName:/thisOfGenericOuterClass.kt overridden: public open fun toString (): kotlin.String declared in .Outer.Inner $this: VALUE_PARAMETER name: type:kotlin.Any - CALL 'public constructor () [primary] declared in .test.' type=.test. origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .test.' type=.test. origin=OBJECT_LITERAL diff --git a/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.txt b/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.txt index 86622ba9cf2..888e67fa9fb 100644 --- a/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.txt +++ b/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.txt @@ -24,7 +24,7 @@ FILE fqName: fileName:/thisReferenceBeforeClassDeclared.kt overridden: public open fun toString (): kotlin.String declared in .WithCompanion $this: VALUE_PARAMETER name: type:kotlin.Any - CALL 'public constructor () [primary] declared in .test.' type=.test. origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .test.' type=.test. origin=OBJECT_LITERAL VAR name:test2 type:.test. [val] BLOCK type=.test. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.WithCompanion] @@ -48,7 +48,7 @@ FILE fqName: fileName:/thisReferenceBeforeClassDeclared.kt overridden: public open fun toString (): kotlin.String declared in .WithCompanion $this: VALUE_PARAMETER name: type:kotlin.Any - CALL 'public constructor () [primary] declared in .test.' type=.test. origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .test.' type=.test. origin=OBJECT_LITERAL CLASS CLASS name:WithCompanion modality:OPEN visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.WithCompanion CONSTRUCTOR visibility:public <> (a:.WithCompanion.Companion) returnType:.WithCompanion [primary] diff --git a/compiler/testData/ir/irText/lambdas/destructuringInLambda.txt b/compiler/testData/ir/irText/lambdas/destructuringInLambda.txt index 6d4193e09ef..5f9c581279c 100644 --- a/compiler/testData/ir/irText/lambdas/destructuringInLambda.txt +++ b/compiler/testData/ir/irText/lambdas/destructuringInLambda.txt @@ -53,7 +53,7 @@ FILE fqName: fileName:/destructuringInLambda.kt $this: GET_VAR ': .A declared in .A.copy' type=.A origin=null BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun copy (x: kotlin.Int, y: kotlin.Int): .A declared in .A' - CALL 'public constructor (x: kotlin.Int, y: kotlin.Int) [primary] declared in .A' type=.A origin=null + CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int, y: kotlin.Int) [primary] declared in .A' type=.A origin=null x: GET_VAR 'x: kotlin.Int declared in .A.copy' type=kotlin.Int origin=null y: GET_VAR 'y: kotlin.Int declared in .A.copy' type=kotlin.Int origin=null FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.String diff --git a/compiler/testData/ir/sourceRanges/declarations/synthesizedDataClassMembers.txt b/compiler/testData/ir/sourceRanges/declarations/synthesizedDataClassMembers.txt index 763fb488797..ec20fd85360 100644 --- a/compiler/testData/ir/sourceRanges/declarations/synthesizedDataClassMembers.txt +++ b/compiler/testData/ir/sourceRanges/declarations/synthesizedDataClassMembers.txt @@ -72,7 +72,7 @@ @0:0..4:1 GET_VAR ': .C declared in .C.copy' type=.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): .C declared in .C' - @0:0..4:1 CALL 'public constructor (x: kotlin.Int, y: kotlin.String, z: kotlin.Any) [primary] declared in .C' type=.C origin=null + @0:0..4:1 CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int, y: kotlin.String, z: kotlin.Any) [primary] declared in .C' type=.C origin=null @0:0..4:1 GET_VAR 'x: kotlin.Int declared in .C.copy' type=kotlin.Int origin=null @0:0..4:1 GET_VAR 'y: kotlin.String declared in .C.copy' type=kotlin.String origin=null @0:0..4:1 GET_VAR 'z: kotlin.Any declared in .C.copy' type=kotlin.Any origin=null