diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/CallGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/CallGenerator.kt index aa3601bf31a..f76051c8852 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/CallGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/CallGenerator.kt @@ -22,6 +22,7 @@ import org.jetbrains.kotlin.descriptors.impl.SyntheticFieldDescriptor import org.jetbrains.kotlin.ir.expressions.* import org.jetbrains.kotlin.ir.expressions.impl.* import org.jetbrains.kotlin.ir.types.IrDynamicType +import org.jetbrains.kotlin.ir.types.IrType import org.jetbrains.kotlin.ir.types.classifierOrFail import org.jetbrains.kotlin.ir.util.referenceFunction import org.jetbrains.kotlin.ir.util.render @@ -34,7 +35,6 @@ import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall import org.jetbrains.kotlin.resolve.calls.model.ResolvedValueArgument import org.jetbrains.kotlin.resolve.calls.tasks.isDynamic import org.jetbrains.kotlin.resolve.calls.util.FakeCallableDescriptorForObject -import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns import org.jetbrains.kotlin.resolve.descriptorUtil.classValueType import org.jetbrains.kotlin.types.KotlinType import java.util.* @@ -50,6 +50,8 @@ class CallGenerator(statementGenerator: StatementGenerator) : StatementGenerator return when (descriptor) { is PropertyDescriptor -> generatePropertyGetterCall(descriptor, startOffset, endOffset, call) + is ClassConstructorDescriptor -> + generateConstructorCall(descriptor, startOffset, endOffset, origin, call) is FunctionDescriptor -> generateFunctionCall(descriptor, startOffset, endOffset, origin, call) else -> @@ -143,7 +145,7 @@ class CallGenerator(statementGenerator: StatementGenerator) : StatementGenerator this.dispatchReceiver = dispatchReceiver?.load() this.extensionReceiver = extensionReceiver?.load() } - addParametersToCall(startOffset, endOffset, call, irCall, descriptor.builtIns.unitType) + addParametersToCall(startOffset, endOffset, call, irCall, context.irBuiltIns.unitType) } fun generateEnumConstructorSuperCall(startOffset: Int, endOffset: Int, call: CallBuilder): IrExpression { @@ -156,8 +158,9 @@ class CallGenerator(statementGenerator: StatementGenerator) : StatementGenerator if (dispatchReceiver != null) throw AssertionError("Dispatch receiver should be null: $dispatchReceiver") if (extensionReceiver != null) throw AssertionError("Extension receiver should be null: $extensionReceiver") val constructorSymbol = context.symbolTable.referenceConstructor(constructorDescriptor.original) - val irCall = IrEnumConstructorCallImpl(startOffset, endOffset, constructorDescriptor.returnType.toIrType(), constructorSymbol) - addParametersToCall(startOffset, endOffset, call, irCall, constructorDescriptor.returnType) + val irResultType = constructorDescriptor.returnType.toIrType() + val irCall = IrEnumConstructorCallImpl(startOffset, endOffset, irResultType, constructorSymbol) + addParametersToCall(startOffset, endOffset, call, irCall, irResultType) } } @@ -234,6 +237,35 @@ class CallGenerator(statementGenerator: StatementGenerator) : StatementGenerator return dispatchReceiver } + private fun generateConstructorCall( + constructorDescriptor: ClassConstructorDescriptor, + startOffset: Int, + endOffset: Int, + origin: IrStatementOrigin?, + call: CallBuilder + ): IrExpression = + call.callReceiver.call { dispatchReceiverValue, extensionReceiverValue -> + val irType = constructorDescriptor.returnType.toIrType() + val classTypeParametersCount = constructorDescriptor.constructedClass.original.declaredTypeParameters.size + val totalTypeParametersCount = constructorDescriptor.typeParameters.size + + IrConstructorCallImpl( + startOffset, endOffset, + irType, + context.symbolTable.referenceConstructor(constructorDescriptor.original), + constructorDescriptor, + typeArgumentsCount = totalTypeParametersCount, + constructorTypeArgumentsCount = totalTypeParametersCount - classTypeParametersCount, + valueArgumentsCount = constructorDescriptor.valueParameters.size, + origin = origin + ).run { + putTypeArguments(call.typeArguments) { it.toIrType() } + dispatchReceiver = dispatchReceiverValue?.load() + extensionReceiver = extensionReceiverValue?.load() + addParametersToCall(startOffset, endOffset, call, this, irType) + } + } + private fun generateFunctionCall( functionDescriptor: FunctionDescriptor, startOffset: Int, @@ -242,8 +274,7 @@ class CallGenerator(statementGenerator: StatementGenerator) : StatementGenerator call: CallBuilder ): IrExpression = call.callReceiver.call { dispatchReceiverValue, extensionReceiverValue -> - val returnType = functionDescriptor.returnType!! - val irType = returnType.toIrType() + val irType = functionDescriptor.returnType!!.toIrType() if (functionDescriptor.isDynamic()) { fun makeDynamicOperatorExpression(operator: IrDynamicOperator) = @@ -294,21 +325,19 @@ class CallGenerator(statementGenerator: StatementGenerator) : StatementGenerator ) } } else { - val functionSymbol = context.symbolTable.referenceFunction(functionDescriptor.original) - val superQualifierSymbol = call.superQualifier?.let { context.symbolTable.referenceClass(it) } - val irCall = IrCallImpl( + IrCallImpl( startOffset, endOffset, irType, - functionSymbol, + context.symbolTable.referenceFunction(functionDescriptor.original), functionDescriptor, origin, - superQualifierSymbol - ).apply { + call.superQualifier?.let { context.symbolTable.referenceClass(it) } + ).run { putTypeArguments(call.typeArguments) { it.toIrType() } - this.dispatchReceiver = dispatchReceiverValue?.load() - this.extensionReceiver = extensionReceiverValue?.load() + dispatchReceiver = dispatchReceiverValue?.load() + extensionReceiver = extensionReceiverValue?.load() + addParametersToCall(startOffset, endOffset, call, this, irType) } - addParametersToCall(startOffset, endOffset, call, irCall, returnType) } } @@ -317,10 +346,10 @@ class CallGenerator(statementGenerator: StatementGenerator) : StatementGenerator endOffset: Int, call: CallBuilder, irCall: IrFunctionAccessExpression, - returnType: KotlinType + irResultType: IrType ): IrExpression = if (call.isValueArgumentReorderingRequired()) { - generateCallWithArgumentReordering(irCall, startOffset, endOffset, call, returnType) + generateCallWithArgumentReordering(irCall, startOffset, endOffset, call, irResultType) } else { val valueArguments = call.getValueArgumentsInParameterOrder() for ((index, valueArgument) in valueArguments.withIndex()) { @@ -334,14 +363,14 @@ class CallGenerator(statementGenerator: StatementGenerator) : StatementGenerator startOffset: Int, endOffset: Int, call: CallBuilder, - resultType: KotlinType + irResultType: IrType ): IrExpression { val resolvedCall = call.original val valueArgumentsInEvaluationOrder = resolvedCall.valueArguments.values val valueParameters = resolvedCall.resultingDescriptor.valueParameters - val irBlock = IrBlockImpl(startOffset, endOffset, resultType.toIrType(), IrStatementOrigin.ARGUMENTS_REORDERING_FOR_CALL) + val irBlock = IrBlockImpl(startOffset, endOffset, irResultType, IrStatementOrigin.ARGUMENTS_REORDERING_FOR_CALL) val valueArgumentsToValueParameters = HashMap() for ((index, valueArgument) in resolvedCall.valueArgumentsByIndex!!.withIndex()) { diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrConstructorCall.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrConstructorCall.kt new file mode 100644 index 00000000000..646b97f7f6e --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrConstructorCall.kt @@ -0,0 +1,81 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.ir.expressions + +import org.jetbrains.kotlin.descriptors.ClassConstructorDescriptor +import org.jetbrains.kotlin.ir.symbols.IrConstructorSymbol +import org.jetbrains.kotlin.ir.types.IrType + +interface IrConstructorCall : IrFunctionAccessExpression { + override val descriptor: ClassConstructorDescriptor + override val symbol: IrConstructorSymbol + + val constructorTypeArgumentsCount: Int + + class ConstructorTypeArguments(internal val irConstructorCall: IrConstructorCall) : AbstractList() { + override val size: Int + get() = irConstructorCall.constructorTypeArgumentsCount + + override fun get(index: Int): IrType? = + if (index >= size) + throw IndexOutOfBoundsException("index: $index, size: $size") + else + irConstructorCall.getConstructorTypeArgument(index) + } + + class ClassTypeArguments(internal val irConstructorCall: IrConstructorCall) : AbstractList() { + override val size: Int + get() = irConstructorCall.classTypeArgumentsCount + + override fun get(index: Int): IrType? = + if (index >= size) + throw IndexOutOfBoundsException("index: $index, size: $size") + else + irConstructorCall.getTypeArgument(index) + } +} + +fun IrConstructorCall.getConstructorTypeArgumentIndex(constructorTypeArgumentIndex: Int) = + typeArgumentsCount - constructorTypeArgumentsCount + constructorTypeArgumentIndex + +fun IrConstructorCall.getConstructorTypeArgument(index: Int): IrType? = + getTypeArgument(getConstructorTypeArgumentIndex(index)) + +fun IrConstructorCall.putConstructorTypeArgument(index: Int, type: IrType?) { + putTypeArgument(getConstructorTypeArgumentIndex(index), type) +} + +operator fun IrConstructorCall.ConstructorTypeArguments.set(index: Int, type: IrType?) { + if (index >= size) throw IndexOutOfBoundsException("index: $index, size: $size") + irConstructorCall.putConstructorTypeArgument(index, type) +} + +val IrConstructorCall.classTypeArgumentsCount: Int + get() = typeArgumentsCount - constructorTypeArgumentsCount + +fun IrConstructorCall.getClassTypeArgument(index: Int): IrType? = + getTypeArgument(index) + +fun IrConstructorCall.putClassTypeArgument(index: Int, type: IrType?) { + putTypeArgument(index, type) +} + +operator fun IrConstructorCall.ClassTypeArguments.set(index: Int, type: IrType?) { + if (index >= size) throw IndexOutOfBoundsException("index: $index, size: $size") + irConstructorCall.putClassTypeArgument(index, type) +} + +fun IrConstructorCall.getConstructorTypeArguments() = + IrConstructorCall.ConstructorTypeArguments(this) + +fun IrConstructorCall.getClassTypeArguments() = + IrConstructorCall.ClassTypeArguments(this) + +var IrConstructorCall.outerClassReceiver: IrExpression? + get() = dispatchReceiver + set(value) { + dispatchReceiver = value + } \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrConstructorCallImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrConstructorCallImpl.kt new file mode 100644 index 00000000000..d1cfd7ee813 --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrConstructorCallImpl.kt @@ -0,0 +1,31 @@ +/* + * Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.ir.expressions.impl + +import org.jetbrains.kotlin.descriptors.ClassConstructorDescriptor +import org.jetbrains.kotlin.ir.expressions.IrConstructorCall +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin +import org.jetbrains.kotlin.ir.symbols.IrConstructorSymbol +import org.jetbrains.kotlin.ir.types.IrType +import org.jetbrains.kotlin.ir.visitors.IrElementVisitor + +class IrConstructorCallImpl( + startOffset: Int, + endOffset: Int, + type: IrType, + override val symbol: IrConstructorSymbol, + override val descriptor: ClassConstructorDescriptor, + typeArgumentsCount: Int, + override val constructorTypeArgumentsCount: Int, + valueArgumentsCount: Int, + origin: IrStatementOrigin? = null +) : + IrCallWithIndexedArgumentsBase(startOffset, endOffset, type, typeArgumentsCount, valueArgumentsCount, origin), + IrConstructorCall { + + override fun accept(visitor: IrElementVisitor, data: D): R = + visitor.visitConstructorCall(this, data) +} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeepCopyIrTreeWithSymbols.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeepCopyIrTreeWithSymbols.kt index 56ca8b93b5f..c4e78f48523 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeepCopyIrTreeWithSymbols.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DeepCopyIrTreeWithSymbols.kt @@ -457,6 +457,23 @@ open class DeepCopyIrTreeWithSymbols( transformValueArguments(expression) } + override fun visitConstructorCall(expression: IrConstructorCall): IrConstructorCall { + val constructorSymbol = symbolRemapper.getReferencedConstructor(expression.symbol) + return IrConstructorCallImpl( + expression.startOffset, expression.endOffset, + expression.type.remapType(), + constructorSymbol, + constructorSymbol.descriptor, + expression.typeArgumentsCount, + expression.constructorTypeArgumentsCount, + expression.valueArgumentsCount, + mapStatementOrigin(expression.origin) + ).apply { + copyRemappedTypeArgumentsFrom(expression) + transformValueArguments(expression) + } + } + private fun IrMemberAccessExpression.copyRemappedTypeArgumentsFrom(other: IrMemberAccessExpression) { assert(typeArgumentsCount == other.typeArgumentsCount) { "Mismatching type arguments: $typeArgumentsCount vs ${other.typeArgumentsCount} " diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DumpIrTree.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DumpIrTree.kt index ef28aeacc85..7df2f16b4f3 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DumpIrTree.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/DumpIrTree.kt @@ -171,12 +171,34 @@ class DumpIrTreeVisitor( } } + override fun visitConstructorCall(expression: IrConstructorCall, data: String) { + expression.dumpLabeledElementWith(data) { + dumpTypeArguments(expression) + expression.outerClassReceiver?.accept(this, "\$outer") + val valueParameterNames = expression.getValueParameterNames(expression.valueArgumentsCount) + for (index in 0 until expression.valueArgumentsCount) { + expression.getValueArgument(index)?.accept(this, valueParameterNames[index]) + } + } + } + private fun dumpTypeArguments(expression: IrMemberAccessExpression) { val typeParameterNames = expression.getTypeParameterNames(expression.typeArgumentsCount) for (index in 0 until expression.typeArgumentsCount) { - printer.println( - "<${typeParameterNames[index]}>: ${expression.renderTypeArgument(index)}" - ) + printer.println("<${typeParameterNames[index]}>: ${expression.renderTypeArgument(index)}") + } + } + + private fun dumpTypeArguments(expression: IrConstructorCall) { + val typeParameterNames = expression.getTypeParameterNames(expression.typeArgumentsCount) + for (index in 0 until expression.typeArgumentsCount) { + val typeParameterName = typeParameterNames[index] + val parameterLabel = + if (index < expression.classTypeArgumentsCount) + "class: $typeParameterName" + else + typeParameterName + printer.println("<$parameterLabel>: ${expression.renderTypeArgument(index)}") } } @@ -220,31 +242,13 @@ class DumpIrTreeVisitor( getPlaceholderParameterNames(expectedCount) } - private fun IrConstructor.getFullTypeParametersList(): List = - getConstructedClassTypeParameters().apply { addAll(typeParameters) } - - private fun IrConstructor.getConstructedClassTypeParameters(): MutableList { - val typeParameters = ArrayList() + private fun IrConstructor.getFullTypeParametersList(): List { val parentClass = try { parent as? IrClass ?: return typeParameters } catch (e: Exception) { return typeParameters } - parentClass.collectClassTypeParameters(typeParameters) - return typeParameters - } - - private fun IrClass.collectClassTypeParameters(typeParameters: MutableList) { - var currentClass = this - while (true) { - typeParameters.addAll(currentClass.typeParameters) - if (!currentClass.isInner) return - currentClass = try { - currentClass.parent as? IrClass ?: return - } catch (e: Exception) { - return - } - } + return parentClass.typeParameters + typeParameters } private fun IrMemberAccessExpression.renderTypeArgument(index: Int): String = diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/RenderIrElement.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/RenderIrElement.kt index 8539b375dd7..1b592dae6e9 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/RenderIrElement.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/RenderIrElement.kt @@ -39,6 +39,9 @@ class RenderIrElementVisitor : IrElementVisitor { fun renderSymbolReference(symbol: IrSymbol) = symbol.renderReference() + private inline fun buildTrimEnd(fn: StringBuilder.() -> Unit): String = + buildString(fn).trimEnd() + private fun IrType.render() = "${renderTypeAnnotations(annotations)}${renderTypeInner()}" @@ -48,7 +51,7 @@ class RenderIrElementVisitor : IrElementVisitor { is IrErrorType -> "IrErrorType" - is IrSimpleType -> buildString { + is IrSimpleType -> buildTrimEnd { append(classifier.renderClassifierFqn()) if (arguments.isNotEmpty()) { append( @@ -69,7 +72,7 @@ class RenderIrElementVisitor : IrElementVisitor { when (this) { is IrStarProjection -> "*" - is IrTypeProjection -> buildString { + is IrTypeProjection -> buildTrimEnd { append(variance.label) if (variance != Variance.INVARIANT) append(' ') append(type.render()) @@ -100,7 +103,7 @@ class RenderIrElementVisitor : IrElementVisitor { element.accept(this@RenderIrElementVisitor, null) override fun visitVariable(declaration: IrVariable, data: Nothing?) = - buildString { + buildTrimEnd { if (declaration.isVar) append("var ") else append("val ") append(declaration.name.asString()) @@ -114,7 +117,7 @@ class RenderIrElementVisitor : IrElementVisitor { } override fun visitValueParameter(declaration: IrValueParameter, data: Nothing?) = - buildString { + buildTrimEnd { append(declaration.name.asString()) append(": ") append(declaration.type.render()) @@ -126,7 +129,7 @@ class RenderIrElementVisitor : IrElementVisitor { } override fun visitFunction(declaration: IrFunction, data: Nothing?) = - buildString { + buildTrimEnd { append(declaration.visibility) append(' ') @@ -184,7 +187,7 @@ class RenderIrElementVisitor : IrElementVisitor { } override fun visitProperty(declaration: IrProperty, data: Nothing?) = - buildString { + buildTrimEnd { append(declaration.visibility) append(' ') append(declaration.modality.toString().toLowerCase()) @@ -203,7 +206,7 @@ class RenderIrElementVisitor : IrElementVisitor { } override fun visitLocalDelegatedProperty(declaration: IrLocalDelegatedProperty, data: Nothing?): String = - buildString { + buildTrimEnd { if (declaration.isVar) append("var ") else append("val ") append(declaration.name.asString()) append(": ") @@ -459,6 +462,9 @@ class RenderIrElementVisitor : IrElementVisitor { private fun IrCall.renderSuperQualifier(): String = superQualifierSymbol?.let { "superQualifier='${it.renderReference()}' " } ?: "" + override fun visitConstructorCall(expression: IrConstructorCall, data: Nothing?): String = + "CONSTRUCTOR_CALL '${expression.symbol.renderReference()}' type=${expression.type.render()} origin=${expression.origin}" + override fun visitDelegatingConstructorCall(expression: IrDelegatingConstructorCall, data: Nothing?): String = "DELEGATING_CONSTRUCTOR_CALL '${expression.symbol.renderReference()}'" @@ -517,7 +523,7 @@ class RenderIrElementVisitor : IrElementVisitor { "FUNCTION_REFERENCE '${expression.symbol.renderReference()}' type=${expression.type.render()} origin=${expression.origin}" override fun visitPropertyReference(expression: IrPropertyReference, data: Nothing?): String = - buildString { + buildTrimEnd { append("PROPERTY_REFERENCE ") append("'${expression.symbol.renderReference()}' ") appendNullableAttribute("field=", expression.field) { "'${it.renderReference()}'" } @@ -538,7 +544,7 @@ class RenderIrElementVisitor : IrElementVisitor { } override fun visitLocalDelegatedPropertyReference(expression: IrLocalDelegatedPropertyReference, data: Nothing?): String = - buildString { + buildTrimEnd { append("LOCAL_DELEGATED_PROPERTY_REFERENCE ") append("'${expression.symbol.renderReference()}' ") append("delegate='${expression.delegate.renderReference()}' ") diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/visitors/IrElementTransformer.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/visitors/IrElementTransformer.kt index 0851a779b0c..21b3f89333f 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/visitors/IrElementTransformer.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/visitors/IrElementTransformer.kt @@ -87,6 +87,7 @@ interface IrElementTransformer : IrElementVisitor { override fun visitMemberAccess(expression: IrMemberAccessExpression, data: D): IrElement = visitExpression(expression, data) override fun visitFunctionAccess(expression: IrFunctionAccessExpression, data: D): IrElement = visitMemberAccess(expression, data) override fun visitCall(expression: IrCall, data: D) = visitFunctionAccess(expression, data) + override fun visitConstructorCall(expression: IrConstructorCall, data: D): IrElement = visitFunctionAccess(expression, data) override fun visitDelegatingConstructorCall(expression: IrDelegatingConstructorCall, data: D) = visitFunctionAccess(expression, data) override fun visitEnumConstructorCall(expression: IrEnumConstructorCall, data: D) = visitFunctionAccess(expression, data) override fun visitGetClass(expression: IrGetClass, data: D) = visitExpression(expression, data) diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/visitors/IrElementTransformerVoid.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/visitors/IrElementTransformerVoid.kt index 609a577761b..c6f19d2abd9 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/visitors/IrElementTransformerVoid.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/visitors/IrElementTransformerVoid.kt @@ -166,6 +166,9 @@ abstract class IrElementTransformerVoid : IrElementTransformer { open fun visitCall(expression: IrCall) = visitFunctionAccess(expression) final override fun visitCall(expression: IrCall, data: Nothing?) = visitCall(expression) + open fun visitConstructorCall(expression: IrConstructorCall) = visitFunctionAccess(expression) + final override fun visitConstructorCall(expression: IrConstructorCall, data: Nothing?) = visitConstructorCall(expression) + open fun visitDelegatingConstructorCall(expression: IrDelegatingConstructorCall) = visitFunctionAccess(expression) final override fun visitDelegatingConstructorCall(expression: IrDelegatingConstructorCall, data: Nothing?) = visitDelegatingConstructorCall(expression) diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/visitors/IrElementVisitor.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/visitors/IrElementVisitor.kt index 25c96348aa3..8ff1ab7c908 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/visitors/IrElementVisitor.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/visitors/IrElementVisitor.kt @@ -73,6 +73,7 @@ interface IrElementVisitor { fun visitMemberAccess(expression: IrMemberAccessExpression, data: D) = visitExpression(expression, data) fun visitFunctionAccess(expression: IrFunctionAccessExpression, data: D) = visitMemberAccess(expression, data) fun visitCall(expression: IrCall, data: D) = visitFunctionAccess(expression, data) + fun visitConstructorCall(expression: IrConstructorCall, data: D) = visitFunctionAccess(expression, data) fun visitDelegatingConstructorCall(expression: IrDelegatingConstructorCall, data: D) = visitFunctionAccess(expression, data) fun visitEnumConstructorCall(expression: IrEnumConstructorCall, data: D) = visitFunctionAccess(expression, data) fun visitGetClass(expression: IrGetClass, data: D) = visitExpression(expression, data) diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/visitors/IrElementVisitorVoid.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/visitors/IrElementVisitorVoid.kt index e055a7ec883..a5214f891c1 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/visitors/IrElementVisitorVoid.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/visitors/IrElementVisitorVoid.kt @@ -158,6 +158,9 @@ interface IrElementVisitorVoid : IrElementVisitor { fun visitCall(expression: IrCall) = visitFunctionAccess(expression) override fun visitCall(expression: IrCall, data: Nothing?) = visitCall(expression) + fun visitConstructorCall(expression: IrConstructorCall) = visitFunctionAccess(expression) + override fun visitConstructorCall(expression: IrConstructorCall, data: Nothing?) = visitConstructorCall(expression) + fun visitDelegatingConstructorCall(expression: IrDelegatingConstructorCall) = visitFunctionAccess(expression) override fun visitDelegatingConstructorCall(expression: IrDelegatingConstructorCall, data: Nothing?) = visitDelegatingConstructorCall(expression) diff --git a/compiler/testData/ir/irJsText/native/nativeNativeKotlin.txt b/compiler/testData/ir/irJsText/native/nativeNativeKotlin.txt index 60c33348525..a304fb6aea5 100644 --- a/compiler/testData/ir/irJsText/native/nativeNativeKotlin.txt +++ b/compiler/testData/ir/irJsText/native/nativeNativeKotlin.txt @@ -69,6 +69,6 @@ FILE fqName:foo fileName:/nativeNativeKotlin.kt FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:c type:foo.C [val] - CALL 'public constructor () [primary] declared in foo.C' type=foo.C origin=null + CONSTRUCTOR_CALL 'public constructor () [primary] declared in foo.C' type=foo.C origin=null RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in foo' CONST String type=kotlin.String value="OK" diff --git a/compiler/testData/ir/irText/classes/localClasses.txt b/compiler/testData/ir/irText/classes/localClasses.txt index 194d57abcd4..0c07e5c682b 100644 --- a/compiler/testData/ir/irText/classes/localClasses.txt +++ b/compiler/testData/ir/irText/classes/localClasses.txt @@ -24,4 +24,4 @@ FILE fqName: fileName:/localClasses.kt public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any CALL 'public final fun foo (): kotlin.Unit declared in .outer.LocalClass' type=kotlin.Unit origin=null - $this: CALL 'public constructor () [primary] declared in .outer.LocalClass' type=.outer.LocalClass origin=null + $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .outer.LocalClass' type=.outer.LocalClass origin=null diff --git a/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.txt b/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.txt index 926eef86b86..400bd2a45f8 100644 --- a/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.txt +++ b/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.txt @@ -36,4 +36,4 @@ FILE fqName: fileName:/delegateFieldWithAnnotations.kt : kotlin.Int $receiver: GET_FIELD 'FIELD DELEGATE name:test1$delegate type:kotlin.Lazy visibility:private [final,static] ' type=kotlin.Lazy origin=null thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final test1: kotlin.Int [delegated,val] ' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE + property: PROPERTY_REFERENCE 'public final test1: kotlin.Int [delegated,val]' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE diff --git a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.txt b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.txt index f65d821a3a7..65b163d1896 100644 --- a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.txt +++ b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.txt @@ -86,7 +86,7 @@ FILE fqName: fileName:/delegatedPropertyAccessorsWithAnnotations.kt PROPERTY name:test1 visibility:public modality:FINAL [delegated,val] FIELD DELEGATE name:test1$delegate type:.Cell visibility:private [final,static] EXPRESSION_BODY - CALL 'public constructor (value: kotlin.Int) [primary] declared in .Cell' type=.Cell origin=null + CONSTRUCTOR_CALL 'public constructor (value: kotlin.Int) [primary] declared in .Cell' type=.Cell origin=null value: CONST Int type=kotlin.Int value=1 FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int annotations: @@ -98,11 +98,11 @@ FILE fqName: fileName:/delegatedPropertyAccessorsWithAnnotations.kt CALL 'public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any?): kotlin.Int declared in .Cell' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD DELEGATE name:test1$delegate type:.Cell visibility:private [final,static] ' type=.Cell origin=null thisRef: CONST Null type=kotlin.Nothing? value=null - kProp: PROPERTY_REFERENCE 'public final test1: kotlin.Int [delegated,val] ' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE + kProp: PROPERTY_REFERENCE 'public final test1: kotlin.Int [delegated,val]' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE PROPERTY name:test2 visibility:public modality:FINAL [delegated,var] FIELD DELEGATE name:test2$delegate type:.Cell visibility:private [final,static] EXPRESSION_BODY - CALL 'public constructor (value: kotlin.Int) [primary] declared in .Cell' type=.Cell origin=null + CONSTRUCTOR_CALL 'public constructor (value: kotlin.Int) [primary] declared in .Cell' type=.Cell origin=null value: CONST Int type=kotlin.Int value=2 FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int annotations: @@ -114,7 +114,7 @@ FILE fqName: fileName:/delegatedPropertyAccessorsWithAnnotations.kt CALL 'public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any?): kotlin.Int declared in .Cell' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD DELEGATE name:test2$delegate type:.Cell visibility:private [final,static] ' type=.Cell origin=null thisRef: CONST Null type=kotlin.Nothing? value=null - kProp: PROPERTY_REFERENCE 'public final test2: kotlin.Int [delegated,var] ' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE + kProp: PROPERTY_REFERENCE 'public final test2: kotlin.Int [delegated,var]' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit annotations: CALL 'public constructor (x: kotlin.String) [primary] declared in .A' type=.A origin=null @@ -129,5 +129,5 @@ FILE fqName: fileName:/delegatedPropertyAccessorsWithAnnotations.kt CALL 'public final fun setValue (thisRef: kotlin.Any?, kProp: kotlin.Any?, newValue: kotlin.Int): kotlin.Unit declared in .Cell' type=kotlin.Unit origin=null $this: GET_FIELD 'FIELD DELEGATE name:test2$delegate type:.Cell visibility:private [final,static] ' type=.Cell origin=null thisRef: CONST Null type=kotlin.Nothing? value=null - kProp: PROPERTY_REFERENCE 'public final test2: kotlin.Int [delegated,var] ' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE + kProp: PROPERTY_REFERENCE 'public final test2: kotlin.Int [delegated,var]' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE newValue: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/declarations/classLevelProperties.txt b/compiler/testData/ir/irText/declarations/classLevelProperties.txt index 4227392ac6f..f12246f17e7 100644 --- a/compiler/testData/ir/irText/declarations/classLevelProperties.txt +++ b/compiler/testData/ir/irText/declarations/classLevelProperties.txt @@ -112,7 +112,7 @@ FILE fqName: fileName:/classLevelProperties.kt $receiver: GET_FIELD 'FIELD DELEGATE name:test7$delegate type:kotlin.Lazy visibility:private [final] ' type=kotlin.Lazy origin=null receiver: GET_VAR ': .C declared in .C.' type=.C origin=null thisRef: GET_VAR ': .C declared in .C.' type=.C origin=null - property: PROPERTY_REFERENCE 'public final test7: kotlin.Int [delegated,val] ' field=null getter='public final fun (): kotlin.Int declared in .C' setter=null type=kotlin.reflect.KProperty1<.C, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE + property: PROPERTY_REFERENCE 'public final test7: kotlin.Int [delegated,val]' field=null getter='public final fun (): kotlin.Int declared in .C' setter=null type=kotlin.reflect.KProperty1<.C, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE PROPERTY name:test8 visibility:public modality:FINAL [delegated,var] FIELD DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final] EXPRESSION_BODY @@ -130,7 +130,7 @@ FILE fqName: fileName:/classLevelProperties.kt $receiver: GET_FIELD 'FIELD DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final] ' type=java.util.HashMap origin=null receiver: GET_VAR ': .C declared in .C.' type=.C origin=null thisRef: GET_VAR ': .C declared in .C.' type=.C origin=null - property: PROPERTY_REFERENCE 'public final test8: kotlin.Int [delegated,var] ' field=null getter='public final fun (): kotlin.Int declared in .C' setter='public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.reflect.KMutableProperty1<.C, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE + property: PROPERTY_REFERENCE 'public final test8: kotlin.Int [delegated,var]' field=null getter='public final fun (): kotlin.Int declared in .C' setter='public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.reflect.KMutableProperty1<.C, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C, :kotlin.Int) returnType:kotlin.Unit correspondingProperty: PROPERTY name:test8 visibility:public modality:FINAL [delegated,var] $this: VALUE_PARAMETER name: type:.C @@ -142,7 +142,7 @@ FILE fqName: fileName:/classLevelProperties.kt $receiver: GET_FIELD 'FIELD DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final] ' type=java.util.HashMap origin=null receiver: GET_VAR ': .C declared in .C.' type=.C origin=null thisRef: GET_VAR ': .C declared in .C.' type=.C origin=null - property: PROPERTY_REFERENCE 'public final test8: kotlin.Int [delegated,var] ' field=null getter='public final fun (): kotlin.Int declared in .C' setter='public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.reflect.KMutableProperty1<.C, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE + property: PROPERTY_REFERENCE 'public final test8: kotlin.Int [delegated,var]' field=null getter='public final fun (): kotlin.Int declared in .C' setter='public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.reflect.KMutableProperty1<.C, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: diff --git a/compiler/testData/ir/irText/declarations/delegatedProperties.txt b/compiler/testData/ir/irText/declarations/delegatedProperties.txt index b24b5e7b86a..84297c4b668 100644 --- a/compiler/testData/ir/irText/declarations/delegatedProperties.txt +++ b/compiler/testData/ir/irText/declarations/delegatedProperties.txt @@ -18,7 +18,7 @@ FILE fqName: fileName:/delegatedProperties.kt : kotlin.Int $receiver: GET_FIELD 'FIELD DELEGATE name:test1$delegate type:kotlin.Lazy visibility:private [final,static] ' type=kotlin.Lazy origin=null thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final test1: kotlin.Int [delegated,val] ' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE + property: PROPERTY_REFERENCE 'public final test1: kotlin.Int [delegated,val]' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C CONSTRUCTOR visibility:public <> (map:kotlin.collections.MutableMap) returnType:.C [primary] @@ -58,7 +58,7 @@ FILE fqName: fileName:/delegatedProperties.kt $receiver: GET_FIELD 'FIELD DELEGATE name:test2$delegate type:kotlin.Lazy visibility:private [final] ' type=kotlin.Lazy origin=null receiver: GET_VAR ': .C declared in .C.' type=.C origin=null thisRef: GET_VAR ': .C declared in .C.' type=.C origin=null - property: PROPERTY_REFERENCE 'public final test2: kotlin.Int [delegated,val] ' field=null getter='public final fun (): kotlin.Int declared in .C' setter=null type=kotlin.reflect.KProperty1<.C, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE + property: PROPERTY_REFERENCE 'public final test2: kotlin.Int [delegated,val]' field=null getter='public final fun (): kotlin.Int declared in .C' setter=null type=kotlin.reflect.KProperty1<.C, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE PROPERTY name:test3 visibility:public modality:FINAL [delegated,var] FIELD DELEGATE name:test3$delegate type:kotlin.collections.MutableMap visibility:private [final] EXPRESSION_BODY @@ -75,7 +75,7 @@ FILE fqName: fileName:/delegatedProperties.kt $receiver: GET_FIELD 'FIELD DELEGATE name:test3$delegate type:kotlin.collections.MutableMap visibility:private [final] ' type=kotlin.collections.MutableMap origin=null receiver: GET_VAR ': .C declared in .C.' type=.C origin=null thisRef: GET_VAR ': .C declared in .C.' type=.C origin=null - property: PROPERTY_REFERENCE 'public final test3: kotlin.Any [delegated,var] ' field=null getter='public final fun (): kotlin.Any declared in .C' setter='public final fun (: kotlin.Any): kotlin.Unit declared in .C' type=kotlin.reflect.KMutableProperty1<.C, kotlin.Any> origin=PROPERTY_REFERENCE_FOR_DELEGATE + property: PROPERTY_REFERENCE 'public final test3: kotlin.Any [delegated,var]' field=null getter='public final fun (): kotlin.Any declared in .C' setter='public final fun (: kotlin.Any): kotlin.Unit declared in .C' type=kotlin.reflect.KMutableProperty1<.C, kotlin.Any> origin=PROPERTY_REFERENCE_FOR_DELEGATE FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C, :kotlin.Any) returnType:kotlin.Unit correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [delegated,var] $this: VALUE_PARAMETER name: type:.C @@ -87,7 +87,7 @@ FILE fqName: fileName:/delegatedProperties.kt $receiver: GET_FIELD 'FIELD DELEGATE name:test3$delegate type:kotlin.collections.MutableMap visibility:private [final] ' type=kotlin.collections.MutableMap origin=null receiver: GET_VAR ': .C declared in .C.' type=.C origin=null thisRef: GET_VAR ': .C declared in .C.' type=.C origin=null - property: PROPERTY_REFERENCE 'public final test3: kotlin.Any [delegated,var] ' field=null getter='public final fun (): kotlin.Any declared in .C' setter='public final fun (: kotlin.Any): kotlin.Unit declared in .C' type=kotlin.reflect.KMutableProperty1<.C, kotlin.Any> origin=PROPERTY_REFERENCE_FOR_DELEGATE + property: PROPERTY_REFERENCE 'public final test3: kotlin.Any [delegated,var]' field=null getter='public final fun (): kotlin.Any declared in .C' setter='public final fun (: kotlin.Any): kotlin.Unit declared in .C' type=kotlin.reflect.KMutableProperty1<.C, kotlin.Any> origin=PROPERTY_REFERENCE_FOR_DELEGATE value: GET_VAR ': kotlin.Any declared in .C.' type=kotlin.Any origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: @@ -117,7 +117,7 @@ FILE fqName: fileName:/delegatedProperties.kt : kotlin.Any $receiver: GET_FIELD 'FIELD DELEGATE name:test4$delegate type:java.util.HashMap visibility:private [final,static] ' type=java.util.HashMap origin=null thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final test4: kotlin.Any [delegated,var] ' field=null getter='public final fun (): kotlin.Any declared in ' setter='public final fun (: kotlin.Any): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE + property: PROPERTY_REFERENCE 'public final test4: kotlin.Any [delegated,var]' field=null getter='public final fun (): kotlin.Any declared in ' setter='public final fun (: kotlin.Any): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Any) returnType:kotlin.Unit correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [delegated,var] VALUE_PARAMETER name: index:0 type:kotlin.Any @@ -127,5 +127,5 @@ FILE fqName: fileName:/delegatedProperties.kt : kotlin.Any $receiver: GET_FIELD 'FIELD DELEGATE name:test4$delegate type:java.util.HashMap visibility:private [final,static] ' type=java.util.HashMap origin=null thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final test4: kotlin.Any [delegated,var] ' field=null getter='public final fun (): kotlin.Any declared in ' setter='public final fun (: kotlin.Any): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE + property: PROPERTY_REFERENCE 'public final test4: kotlin.Any [delegated,var]' field=null getter='public final fun (): kotlin.Any declared in ' setter='public final fun (: kotlin.Any): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE value: GET_VAR ': kotlin.Any declared in .' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/declarations/packageLevelProperties.txt b/compiler/testData/ir/irText/declarations/packageLevelProperties.txt index 8089d0a5742..5fec8eeed1a 100644 --- a/compiler/testData/ir/irText/declarations/packageLevelProperties.txt +++ b/compiler/testData/ir/irText/declarations/packageLevelProperties.txt @@ -87,7 +87,7 @@ FILE fqName: fileName:/packageLevelProperties.kt : kotlin.Int $receiver: GET_FIELD 'FIELD DELEGATE name:test7$delegate type:kotlin.Lazy visibility:private [final,static] ' type=kotlin.Lazy origin=null thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final test7: kotlin.Int [delegated,val] ' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE + property: PROPERTY_REFERENCE 'public final test7: kotlin.Int [delegated,val]' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE PROPERTY name:test8 visibility:public modality:FINAL [delegated,var] FIELD DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final,static] EXPRESSION_BODY @@ -103,7 +103,7 @@ FILE fqName: fileName:/packageLevelProperties.kt : kotlin.Int $receiver: GET_FIELD 'FIELD DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final,static] ' type=java.util.HashMap origin=null thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final test8: kotlin.Int [delegated,var] ' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE + property: PROPERTY_REFERENCE 'public final test8: kotlin.Int [delegated,var]' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit correspondingProperty: PROPERTY name:test8 visibility:public modality:FINAL [delegated,var] VALUE_PARAMETER name: index:0 type:kotlin.Int @@ -113,5 +113,5 @@ FILE fqName: fileName:/packageLevelProperties.kt : kotlin.Int $receiver: GET_FIELD 'FIELD DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final,static] ' type=java.util.HashMap origin=null thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final test8: kotlin.Int [delegated,var] ' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE + property: PROPERTY_REFERENCE 'public final test8: kotlin.Int [delegated,var]' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.txt b/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.txt index 818fd4d2fae..d82f9296ee7 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.txt @@ -49,10 +49,10 @@ FILE fqName: fileName:/differentReceivers.kt FIELD DELEGATE name:testO$delegate type:kotlin.String visibility:private [final,static] EXPRESSION_BODY CALL 'public final fun provideDelegate (host: kotlin.Any?, p: kotlin.Any): kotlin.String declared in ' type=kotlin.String origin=null - $receiver: CALL 'public constructor (value: kotlin.String) [primary] declared in .MyClass' type=.MyClass origin=null + $receiver: CONSTRUCTOR_CALL 'public constructor (value: kotlin.String) [primary] declared in .MyClass' type=.MyClass origin=null value: CONST String type=kotlin.String value="O" host: CONST Null type=kotlin.Nothing? value=null - p: PROPERTY_REFERENCE 'public final testO: kotlin.String [delegated,val] ' field=null getter='public final fun (): kotlin.String declared in ' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE + p: PROPERTY_REFERENCE 'public final testO: kotlin.String [delegated,val]' field=null getter='public final fun (): kotlin.String declared in ' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String correspondingProperty: PROPERTY name:testO visibility:public modality:FINAL [delegated,val] BLOCK_BODY @@ -60,7 +60,7 @@ FILE fqName: fileName:/differentReceivers.kt CALL 'public final fun getValue (receiver: kotlin.Any?, p: kotlin.Any): kotlin.String declared in ' type=kotlin.String origin=null $receiver: GET_FIELD 'FIELD DELEGATE name:testO$delegate type:kotlin.String visibility:private [final,static] ' type=kotlin.String origin=null receiver: CONST Null type=kotlin.Nothing? value=null - p: PROPERTY_REFERENCE 'public final testO: kotlin.String [delegated,val] ' field=null getter='public final fun (): kotlin.String declared in ' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE + p: PROPERTY_REFERENCE 'public final testO: kotlin.String [delegated,val]' field=null getter='public final fun (): kotlin.String declared in ' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE PROPERTY name:testK visibility:public modality:FINAL [delegated,val] FIELD DELEGATE name:testK$delegate type:kotlin.String visibility:private [final,static] EXPRESSION_BODY @@ -72,7 +72,7 @@ FILE fqName: fileName:/differentReceivers.kt CALL 'public final fun getValue (receiver: kotlin.Any?, p: kotlin.Any): kotlin.String declared in ' type=kotlin.String origin=null $receiver: GET_FIELD 'FIELD DELEGATE name:testK$delegate type:kotlin.String visibility:private [final,static] ' type=kotlin.String origin=null receiver: CONST Null type=kotlin.Nothing? value=null - p: PROPERTY_REFERENCE 'public final testK: kotlin.String [delegated,val] ' field=null getter='public final fun (): kotlin.String declared in ' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE + p: PROPERTY_REFERENCE 'public final testK: kotlin.String [delegated,val]' field=null getter='public final fun (): kotlin.String declared in ' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE PROPERTY name:testOK visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:testOK type:kotlin.String visibility:public [final,static] EXPRESSION_BODY diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/local.txt b/compiler/testData/ir/irText/declarations/provideDelegate/local.txt index b4b525db78c..0f61bbb222a 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/local.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/local.txt @@ -62,7 +62,7 @@ FILE fqName: fileName:/local.kt VALUE_PARAMETER name:property index:1 type:kotlin.Any? BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun provideDelegate (thisRef: kotlin.Any?, property: kotlin.Any?): .Delegate declared in .DelegateProvider' - CALL 'public constructor (value: kotlin.String) [primary] declared in .Delegate' type=.Delegate origin=null + CONSTRUCTOR_CALL 'public constructor (value: kotlin.String) [primary] declared in .Delegate' type=.Delegate origin=null value: CALL 'public final fun (): kotlin.String declared in .DelegateProvider' type=kotlin.String origin=GET_PROPERTY $this: GET_VAR ': .DelegateProvider declared in .DelegateProvider.provideDelegate' type=.DelegateProvider origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean @@ -83,7 +83,7 @@ FILE fqName: fileName:/local.kt LOCAL_DELEGATED_PROPERTY name:testMember type:kotlin.String flags:val VAR DELEGATE name:testMember$delegate type:.Delegate [val] CALL 'public final fun provideDelegate (thisRef: kotlin.Any?, property: kotlin.Any?): .Delegate declared in .DelegateProvider' type=.Delegate origin=null - $this: CALL 'public constructor (value: kotlin.String) [primary] declared in .DelegateProvider' type=.DelegateProvider origin=null + $this: CONSTRUCTOR_CALL 'public constructor (value: kotlin.String) [primary] declared in .DelegateProvider' type=.DelegateProvider origin=null value: CONST String type=kotlin.String value="OK" thisRef: CONST Null type=kotlin.Nothing? value=null property: LOCAL_DELEGATED_PROPERTY_REFERENCE 'val testMember: kotlin.String by (...)' delegate='val testMember$delegate: .Delegate [val] declared in .foo' getter='local final fun (): kotlin.String declared in .foo' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.txt b/compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.txt index b407a01248a..e4c0d0a7fb0 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.txt @@ -50,7 +50,7 @@ FILE fqName: fileName:/localDifferentReceivers.kt LOCAL_DELEGATED_PROPERTY name:testO type:kotlin.String flags:val VAR DELEGATE name:testO$delegate type:kotlin.String [val] CALL 'public final fun provideDelegate (host: kotlin.Any?, p: kotlin.Any): kotlin.String declared in ' type=kotlin.String origin=null - $receiver: CALL 'public constructor (value: kotlin.String) [primary] declared in .MyClass' type=.MyClass origin=null + $receiver: CONSTRUCTOR_CALL 'public constructor (value: kotlin.String) [primary] declared in .MyClass' type=.MyClass origin=null value: CONST String type=kotlin.String value="O" host: CONST Null type=kotlin.Nothing? value=null p: LOCAL_DELEGATED_PROPERTY_REFERENCE 'val testO: kotlin.String by (...)' delegate='val testO$delegate: kotlin.String [val] declared in .box' getter='local final fun (): kotlin.String declared in .box' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/member.txt b/compiler/testData/ir/irText/declarations/provideDelegate/member.txt index 9fdd3ef5768..b98bc729459 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/member.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/member.txt @@ -62,7 +62,7 @@ FILE fqName: fileName:/member.kt VALUE_PARAMETER name:property index:1 type:kotlin.Any? BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun provideDelegate (thisRef: kotlin.Any?, property: kotlin.Any?): .Delegate declared in .DelegateProvider' - CALL 'public constructor (value: kotlin.String) [primary] declared in .Delegate' type=.Delegate origin=null + CONSTRUCTOR_CALL 'public constructor (value: kotlin.String) [primary] declared in .Delegate' type=.Delegate origin=null value: CALL 'public final fun (): kotlin.String declared in .DelegateProvider' type=kotlin.String origin=GET_PROPERTY $this: GET_VAR ': .DelegateProvider declared in .DelegateProvider.provideDelegate' type=.DelegateProvider origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean @@ -88,10 +88,10 @@ FILE fqName: fileName:/member.kt FIELD DELEGATE name:testMember$delegate type:.Delegate visibility:private [final] EXPRESSION_BODY CALL 'public final fun provideDelegate (thisRef: kotlin.Any?, property: kotlin.Any?): .Delegate declared in .DelegateProvider' type=.Delegate origin=null - $this: CALL 'public constructor (value: kotlin.String) [primary] declared in .DelegateProvider' type=.DelegateProvider origin=null + $this: CONSTRUCTOR_CALL 'public constructor (value: kotlin.String) [primary] declared in .DelegateProvider' type=.DelegateProvider origin=null value: CONST String type=kotlin.String value="OK" thisRef: GET_VAR ': .Host declared in .Host' type=.Host origin=null - property: PROPERTY_REFERENCE 'public final testMember: kotlin.String [delegated,val] ' field=null getter='public final fun (): kotlin.String declared in .Host' setter=null type=kotlin.reflect.KProperty1<.Host, kotlin.String> origin=PROPERTY_REFERENCE_FOR_DELEGATE + property: PROPERTY_REFERENCE 'public final testMember: kotlin.String [delegated,val]' field=null getter='public final fun (): kotlin.String declared in .Host' setter=null type=kotlin.reflect.KProperty1<.Host, kotlin.String> origin=PROPERTY_REFERENCE_FOR_DELEGATE FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.String correspondingProperty: PROPERTY name:testMember visibility:public modality:FINAL [delegated,val] $this: VALUE_PARAMETER name: type:.Host @@ -101,7 +101,7 @@ FILE fqName: fileName:/member.kt $this: GET_FIELD 'FIELD DELEGATE name:testMember$delegate type:.Delegate visibility:private [final] ' type=.Delegate origin=null receiver: GET_VAR ': .Host declared in .Host.' type=.Host origin=null thisRef: GET_VAR ': .Host declared in .Host.' type=.Host origin=null - property: PROPERTY_REFERENCE 'public final testMember: kotlin.String [delegated,val] ' field=null getter='public final fun (): kotlin.String declared in .Host' setter=null type=kotlin.reflect.KProperty1<.Host, kotlin.String> origin=PROPERTY_REFERENCE_FOR_DELEGATE + property: PROPERTY_REFERENCE 'public final testMember: kotlin.String [delegated,val]' field=null getter='public final fun (): kotlin.String declared in .Host' setter=null type=kotlin.reflect.KProperty1<.Host, kotlin.String> origin=PROPERTY_REFERENCE_FOR_DELEGATE 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/declarations/provideDelegate/memberExtension.txt b/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.txt index 202c5389aee..be909c26553 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.txt @@ -53,7 +53,7 @@ FILE fqName: fileName:/memberExtension.kt VALUE_PARAMETER name:p index:1 type:kotlin.Any BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun provideDelegate (host: kotlin.Any?, p: kotlin.Any): .Host.StringDelegate declared in .Host' - CALL 'public constructor (s: kotlin.String) [primary] declared in .Host.StringDelegate' type=.Host.StringDelegate origin=null + CONSTRUCTOR_CALL 'public constructor (s: kotlin.String) [primary] declared in .Host.StringDelegate' type=.Host.StringDelegate origin=null s: GET_VAR ': kotlin.String declared in .Host.provideDelegate' type=kotlin.String origin=null PROPERTY name:plusK visibility:public modality:FINAL [delegated,val] FIELD DELEGATE name:plusK$delegate type:.Host.StringDelegate visibility:private [final] @@ -62,7 +62,7 @@ FILE fqName: fileName:/memberExtension.kt $this: GET_VAR ': .Host declared in .Host' type=.Host origin=null $receiver: CONST String type=kotlin.String value="K" host: GET_VAR ': .Host declared in .Host' type=.Host origin=null - p: PROPERTY_REFERENCE 'public final plusK: kotlin.String [delegated,val] ' field=null getter='public final fun (): kotlin.String declared in .Host' setter=null type=kotlin.reflect.KProperty2.Host, kotlin.String> origin=PROPERTY_REFERENCE_FOR_DELEGATE + p: PROPERTY_REFERENCE 'public final plusK: kotlin.String [delegated,val]' field=null getter='public final fun (): kotlin.String declared in .Host' setter=null type=kotlin.reflect.KProperty2.Host, kotlin.String> origin=PROPERTY_REFERENCE_FOR_DELEGATE FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Host, $receiver:kotlin.String) returnType:kotlin.String correspondingProperty: PROPERTY name:plusK visibility:public modality:FINAL [delegated,val] $this: VALUE_PARAMETER name: type:.Host @@ -73,7 +73,7 @@ FILE fqName: fileName:/memberExtension.kt $this: GET_FIELD 'FIELD DELEGATE name:plusK$delegate type:.Host.StringDelegate visibility:private [final] ' type=.Host.StringDelegate origin=null receiver: GET_VAR ': .Host declared in .Host.' type=.Host origin=null receiver: GET_VAR ': kotlin.String declared in .Host.' type=kotlin.String origin=null - p: PROPERTY_REFERENCE 'public final plusK: kotlin.String [delegated,val] ' field=null getter='public final fun (): kotlin.String declared in .Host' setter=null type=kotlin.reflect.KProperty2.Host, kotlin.String> origin=PROPERTY_REFERENCE_FOR_DELEGATE + p: PROPERTY_REFERENCE 'public final plusK: kotlin.String [delegated,val]' field=null getter='public final fun (): kotlin.String declared in .Host' setter=null type=kotlin.reflect.KProperty2.Host, kotlin.String> origin=PROPERTY_REFERENCE_FOR_DELEGATE PROPERTY name:ok visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:ok type:kotlin.String visibility:public [final] EXPRESSION_BODY diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.txt b/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.txt index b1ff330e4d8..9dfa72c02fe 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.txt @@ -62,7 +62,7 @@ FILE fqName: fileName:/topLevel.kt VALUE_PARAMETER name:property index:1 type:kotlin.Any? BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun provideDelegate (thisRef: kotlin.Any?, property: kotlin.Any?): .Delegate declared in .DelegateProvider' - CALL 'public constructor (value: kotlin.String) [primary] declared in .Delegate' type=.Delegate origin=null + CONSTRUCTOR_CALL 'public constructor (value: kotlin.String) [primary] declared in .Delegate' type=.Delegate origin=null value: CALL 'public final fun (): kotlin.String declared in .DelegateProvider' type=kotlin.String origin=GET_PROPERTY $this: GET_VAR ': .DelegateProvider declared in .DelegateProvider.provideDelegate' type=.DelegateProvider origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean @@ -82,10 +82,10 @@ FILE fqName: fileName:/topLevel.kt FIELD DELEGATE name:testTopLevel$delegate type:.Delegate visibility:private [final,static] EXPRESSION_BODY CALL 'public final fun provideDelegate (thisRef: kotlin.Any?, property: kotlin.Any?): .Delegate declared in .DelegateProvider' type=.Delegate origin=null - $this: CALL 'public constructor (value: kotlin.String) [primary] declared in .DelegateProvider' type=.DelegateProvider origin=null + $this: CONSTRUCTOR_CALL 'public constructor (value: kotlin.String) [primary] declared in .DelegateProvider' type=.DelegateProvider origin=null value: CONST String type=kotlin.String value="OK" thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final testTopLevel: kotlin.String [delegated,val] ' field=null getter='public final fun (): kotlin.String declared in ' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE + property: PROPERTY_REFERENCE 'public final testTopLevel: kotlin.String [delegated,val]' field=null getter='public final fun (): kotlin.String declared in ' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String correspondingProperty: PROPERTY name:testTopLevel visibility:public modality:FINAL [delegated,val] BLOCK_BODY @@ -93,4 +93,4 @@ FILE fqName: fileName:/topLevel.kt CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.Any?): kotlin.String declared in .Delegate' type=kotlin.String origin=null $this: GET_FIELD 'FIELD DELEGATE name:testTopLevel$delegate type:.Delegate visibility:private [final,static] ' type=.Delegate origin=null thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final testTopLevel: kotlin.String [delegated,val] ' field=null getter='public final fun (): kotlin.String declared in ' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE + property: PROPERTY_REFERENCE 'public final testTopLevel: kotlin.String [delegated,val]' field=null getter='public final fun (): kotlin.String declared in ' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE diff --git a/compiler/testData/ir/irText/expressions/augmentedAssignment2.txt b/compiler/testData/ir/irText/expressions/augmentedAssignment2.txt index 6ae176354e0..9beab2848e4 100644 --- a/compiler/testData/ir/irText/expressions/augmentedAssignment2.txt +++ b/compiler/testData/ir/irText/expressions/augmentedAssignment2.txt @@ -41,7 +41,7 @@ FILE fqName: fileName:/augmentedAssignment2.kt PROPERTY name:p visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:p type:.A visibility:public [final,static] EXPRESSION_BODY - CALL 'public constructor () [primary] declared in .A' type=.A origin=null + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .A' type=.A origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.A correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [val] BLOCK_BODY @@ -50,7 +50,7 @@ FILE fqName: fileName:/augmentedAssignment2.kt FUN name:testVariable visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:a type:.A [val] - CALL 'public constructor () [primary] declared in .A' type=.A origin=null + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .A' type=.A origin=null CALL 'public final fun plusAssign (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=PLUSEQ $receiver: GET_VAR 'val a: .A [val] declared in .testVariable' type=.A origin=PLUSEQ s: CONST String type=kotlin.String value="+=" diff --git a/compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.txt b/compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.txt index 6f5dd522386..d1aefa7a90d 100644 --- a/compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.txt +++ b/compiler/testData/ir/irText/expressions/augmentedAssignmentWithExpression.txt @@ -31,7 +31,7 @@ FILE fqName: fileName:/augmentedAssignmentWithExpression.kt FUN name:foo visibility:public modality:FINAL <> () returnType:.Host BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun foo (): .Host declared in ' - CALL 'public constructor () [primary] declared in .Host' type=.Host origin=null + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Host' type=.Host origin=null FUN name:test2 visibility:public modality:FINAL <> ($receiver:.Host) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:.Host BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/boundCallableReferences.txt b/compiler/testData/ir/irText/expressions/boundCallableReferences.txt index 33657ee414c..ae739a436de 100644 --- a/compiler/testData/ir/irText/expressions/boundCallableReferences.txt +++ b/compiler/testData/ir/irText/expressions/boundCallableReferences.txt @@ -39,7 +39,7 @@ FILE fqName: fileName:/boundCallableReferences.kt FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.reflect.KFunction0 visibility:public [final,static] EXPRESSION_BODY FUNCTION_REFERENCE 'public final fun foo (): kotlin.Unit declared in .A' type=kotlin.reflect.KFunction0 origin=null - $this: CALL 'public constructor () [primary] declared in .A' type=.A origin=null + $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .A' type=.A origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction0 correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] BLOCK_BODY @@ -48,8 +48,8 @@ FILE fqName: fileName:/boundCallableReferences.kt PROPERTY name:test2 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.reflect.KProperty0 visibility:public [final,static] EXPRESSION_BODY - PROPERTY_REFERENCE 'public final bar: kotlin.Int [val] ' field=null getter='public final fun (): kotlin.Int declared in .A' setter=null type=kotlin.reflect.KProperty0 origin=null - $this: CALL 'public constructor () [primary] declared in .A' type=.A origin=null + PROPERTY_REFERENCE 'public final bar: kotlin.Int [val]' field=null getter='public final fun (): kotlin.Int declared in .A' setter=null type=kotlin.reflect.KProperty0 origin=null + $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .A' type=.A origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KProperty0 correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] BLOCK_BODY @@ -59,7 +59,7 @@ FILE fqName: fileName:/boundCallableReferences.kt FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.reflect.KFunction0 visibility:public [final,static] EXPRESSION_BODY FUNCTION_REFERENCE 'public final fun qux (): kotlin.Unit declared in ' type=kotlin.reflect.KFunction0 origin=null - $receiver: CALL 'public constructor () [primary] declared in .A' type=.A origin=null + $receiver: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .A' type=.A origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction0 correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [val] BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/callableRefToGenericMember.txt b/compiler/testData/ir/irText/expressions/callableRefToGenericMember.txt index 349adf9bdb8..2c5b30ebd6b 100644 --- a/compiler/testData/ir/irText/expressions/callableRefToGenericMember.txt +++ b/compiler/testData/ir/irText/expressions/callableRefToGenericMember.txt @@ -45,7 +45,7 @@ FILE fqName: fileName:/callableRefToGenericMember.kt PROPERTY name:test2 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.reflect.KProperty1<.A, kotlin.Int> visibility:public [final,static] EXPRESSION_BODY - PROPERTY_REFERENCE 'public final bar: kotlin.Int [val] ' field=null getter='public final fun (): kotlin.Int declared in .A' setter=null type=kotlin.reflect.KProperty1<.A, kotlin.Int> origin=null + PROPERTY_REFERENCE 'public final bar: kotlin.Int [val]' field=null getter='public final fun (): kotlin.Int declared in .A' setter=null type=kotlin.reflect.KProperty1<.A, kotlin.Int> origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KProperty1<.A, kotlin.Int> correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/callableReferenceToImportedFromObject.txt b/compiler/testData/ir/irText/expressions/callableReferenceToImportedFromObject.txt index 2ec9410f0e8..266680248d9 100644 --- a/compiler/testData/ir/irText/expressions/callableReferenceToImportedFromObject.txt +++ b/compiler/testData/ir/irText/expressions/callableReferenceToImportedFromObject.txt @@ -37,7 +37,7 @@ FILE fqName:test fileName:/callableReferenceToImportedFromObject.kt PROPERTY name:test1 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.reflect.KProperty0 visibility:public [final,static] EXPRESSION_BODY - PROPERTY_REFERENCE 'public final a: kotlin.String [val] ' field=null getter='public final fun (): kotlin.String declared in test.Foo' setter=null type=kotlin.reflect.KProperty0 origin=null + PROPERTY_REFERENCE 'public final a: kotlin.String [val]' field=null getter='public final fun (): kotlin.String declared in test.Foo' setter=null type=kotlin.reflect.KProperty0 origin=null $this: GET_OBJECT 'CLASS OBJECT name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any]' type=test.Foo FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KProperty0 correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] @@ -47,7 +47,7 @@ FILE fqName:test fileName:/callableReferenceToImportedFromObject.kt PROPERTY name:test1a visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test1a type:kotlin.reflect.KProperty0 visibility:public [final,static] EXPRESSION_BODY - PROPERTY_REFERENCE 'public final a: kotlin.String [val] ' field=null getter='public final fun (): kotlin.String declared in test.Foo' setter=null type=kotlin.reflect.KProperty0 origin=null + PROPERTY_REFERENCE 'public final a: kotlin.String [val]' field=null getter='public final fun (): kotlin.String declared in test.Foo' setter=null type=kotlin.reflect.KProperty0 origin=null $this: GET_OBJECT 'CLASS OBJECT name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any]' type=test.Foo FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KProperty0 correspondingProperty: PROPERTY name:test1a visibility:public modality:FINAL [val] diff --git a/compiler/testData/ir/irText/expressions/classReference.txt b/compiler/testData/ir/irText/expressions/classReference.txt index 93a6b01aa94..91934103a7a 100644 --- a/compiler/testData/ir/irText/expressions/classReference.txt +++ b/compiler/testData/ir/irText/expressions/classReference.txt @@ -24,7 +24,7 @@ FILE fqName: fileName:/classReference.kt CLASS_REFERENCE 'CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.reflect.KClass<.A> TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit GET_CLASS type=kotlin.reflect.KClass.A> - CALL 'public constructor () [primary] declared in .A' type=.A origin=null + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .A' type=.A origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun (): java.lang.Class> declared in kotlin.jvm' type=java.lang.Class<.A> origin=GET_PROPERTY : .A @@ -33,4 +33,4 @@ FILE fqName: fileName:/classReference.kt CALL 'public final fun (): java.lang.Class> declared in kotlin.jvm' type=java.lang.Class.A> origin=GET_PROPERTY : .A $receiver: GET_CLASS type=kotlin.reflect.KClass.A> - CALL 'public constructor () [primary] declared in .A' type=.A origin=null + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .A' type=.A origin=null diff --git a/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.txt b/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.txt index 3e95f2db25b..56323ebf187 100644 --- a/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.txt +++ b/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.txt @@ -263,5 +263,5 @@ FILE fqName: fileName:/complexAugmentedAssignment.kt CALL 'public final fun plusAssign (b: .B): kotlin.Unit declared in .Host' type=kotlin.Unit origin=PLUSEQ $this: GET_VAR ': .Host declared in .test3' type=.Host origin=null $receiver: GET_VAR 'v: .B declared in .test3' type=.B origin=PLUSEQ - b: CALL 'public constructor (s: kotlin.Int) [primary] declared in .B' type=.B origin=null + b: CONSTRUCTOR_CALL 'public constructor (s: kotlin.Int) [primary] declared in .B' type=.B origin=null s: CONST Int type=kotlin.Int value=1000 diff --git a/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.kt b/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.kt new file mode 100644 index 00000000000..0017d149080 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.kt @@ -0,0 +1,19 @@ +// FILE: constructorWithOwnTypeParametersCall.kt +// DUMP_EXTERNAL_CLASS J1 + +fun testKotlin() = K1().K2() + +fun testJava() = J1().J2() + +class K1 { + inner class K2 +} + +// FILE: J1.java +public class J1 { + public J1() {} + + public class J2 { + public J2() {} + } +} diff --git a/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.txt b/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.txt new file mode 100644 index 00000000000..e60d7cfc515 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.txt @@ -0,0 +1,58 @@ +FILE fqName: fileName:/constructorWithOwnTypeParametersCall.kt + FUN name:testKotlin visibility:public modality:FINAL <> () returnType:.K1.K2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testKotlin (): .K1.K2 declared in ' + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .K1.K2' type=.K1.K2 origin=null + : kotlin.String + $outer: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .K1' type=.K1 origin=null + : kotlin.Int + FUN name:testJava visibility:public modality:FINAL <> () returnType:.J1.J2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun testJava (): .J1.J2 declared in ' + CONSTRUCTOR_CALL 'public constructor () declared in .J1.J2' type=.J1.J2 origin=null + : kotlin.Double + : kotlin.CharSequence + $outer: CONSTRUCTOR_CALL 'public constructor () declared in .J1' type=.J1 origin=null + : kotlin.Int + : kotlin.String + CLASS CLASS name:K1 modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.K1.K1> + TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Number] + CONSTRUCTOR visibility:public <> () returnType:.K1.K1> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K1 modality:FINAL visibility:public superTypes:[kotlin.Any]' + CLASS CLASS name:K2 modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.K1.K2.K1.K2, T1 of .K1> + TYPE_PARAMETER name:T2 index:0 variance: superTypes:[kotlin.CharSequence] + CONSTRUCTOR visibility:public <> ($this:.K1.K1>) returnType:.K1.K2.K1.K2, T1 of .K1> [primary] + $outer: VALUE_PARAMETER name: type:.K1.K1> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K2 modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' + 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: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + 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: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall__J1.txt b/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall__J1.txt new file mode 100644 index 00000000000..19b35992dc6 --- /dev/null +++ b/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall__J1.txt @@ -0,0 +1,37 @@ +CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:J1 modality:OPEN visibility:public superTypes:[] + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:.J1.J1> + TYPE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:X1 index:0 variance: superTypes:[?] + CONSTRUCTOR IR_EXTERNAL_DECLARATION_STUB visibility:public () returnType:.J1.J1> + TYPE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:Y1 index:1 variance: superTypes:[?] + CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:J2 modality:OPEN visibility:public [inner] superTypes:[] + $this: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:.J1.J2.J1.J2, X1 of .J1> + TYPE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:X2 index:0 variance: superTypes:[?] + CONSTRUCTOR IR_EXTERNAL_DECLARATION_STUB visibility:public ($this:.J1.J1>) returnType:.J1.J2.J1.J2, X1 of .J1> + TYPE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:Y2 index:1 variance: superTypes:[?] + $outer: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name: type:.J1.J1> + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:) returnType: + overridden: + public open fun hashCode (): declared in kotlin.Any + $this: VALUE_PARAMETER FAKE_OVERRIDE name: type:kotlin.Any + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType: + overridden: + public open fun equals (other: kotlin.Any?): declared in kotlin.Any + $this: VALUE_PARAMETER FAKE_OVERRIDE name: type:kotlin.Any + VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType: + overridden: + public open fun toString (): declared in kotlin.Any + $this: VALUE_PARAMETER FAKE_OVERRIDE name: type:kotlin.Any + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType: + overridden: + public open fun hashCode (): declared in kotlin.Any + $this: VALUE_PARAMETER FAKE_OVERRIDE name: type:kotlin.Any + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType: + overridden: + public open fun equals (other: kotlin.Any?): declared in kotlin.Any + $this: VALUE_PARAMETER FAKE_OVERRIDE name: type:kotlin.Any + VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType: + overridden: + public open fun toString (): declared in kotlin.Any + $this: VALUE_PARAMETER FAKE_OVERRIDE name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/contructorCall.txt b/compiler/testData/ir/irText/expressions/contructorCall.txt index d00ad877a7f..bfbb6739b9b 100644 --- a/compiler/testData/ir/irText/expressions/contructorCall.txt +++ b/compiler/testData/ir/irText/expressions/contructorCall.txt @@ -21,7 +21,7 @@ FILE fqName: fileName:/contructorCall.kt PROPERTY name:test visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test type:.A visibility:public [final,static] EXPRESSION_BODY - CALL 'public constructor () [primary] declared in .A' type=.A origin=null + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .A' type=.A origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.A correspondingProperty: PROPERTY name:test visibility:public modality:FINAL [val] BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.txt b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.txt index 0825b3a0fea..fd971d39d6d 100644 --- a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.txt +++ b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.txt @@ -64,7 +64,7 @@ FILE fqName: fileName:/forWithImplicitReceivers.kt $receiver: VALUE_PARAMETER name: type:.FiveTimes BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun iterator (): .IntCell declared in .IReceiver' - CALL 'public constructor (value: kotlin.Int) [primary] declared in .IntCell' type=.IntCell origin=null + CONSTRUCTOR_CALL 'public constructor (value: kotlin.Int) [primary] declared in .IntCell' type=.IntCell origin=null value: CONST Int type=kotlin.Int value=5 FUN name:hasNext visibility:public modality:OPEN <> ($this:.IReceiver, $receiver:.IntCell) returnType:kotlin.Boolean $this: VALUE_PARAMETER name: type:.IReceiver diff --git a/compiler/testData/ir/irText/expressions/genericPropertyRef.txt b/compiler/testData/ir/irText/expressions/genericPropertyRef.txt index 66dd24c0d9b..293486dd823 100644 --- a/compiler/testData/ir/irText/expressions/genericPropertyRef.txt +++ b/compiler/testData/ir/irText/expressions/genericPropertyRef.txt @@ -67,8 +67,8 @@ FILE fqName: fileName:/genericPropertyRef.kt PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] FIELD DELEGATE name:additionalText$delegate type:.DVal visibility:private [final,static] EXPRESSION_BODY - CALL 'public constructor (kmember: kotlin.Any) [primary] declared in .DVal' type=.DVal origin=null - kmember: PROPERTY_REFERENCE 'public final text: kotlin.String? [var] ' field=null getter='public final fun (): kotlin.String? declared in .Value' setter='public final fun (: kotlin.String?): kotlin.Unit declared in .Value' type=kotlin.reflect.KMutableProperty1<.Value.>, kotlin.String?> origin=null + CONSTRUCTOR_CALL 'public constructor (kmember: kotlin.Any) [primary] declared in .DVal' type=.DVal origin=null + kmember: PROPERTY_REFERENCE 'public final text: kotlin.String? [var]' field=null getter='public final fun (): kotlin.String? declared in .Value' setter='public final fun (: kotlin.String?): kotlin.Unit declared in .Value' type=kotlin.reflect.KMutableProperty1<.Value.>, kotlin.String?> origin=null FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL ($receiver:.Value.>) returnType:kotlin.Int correspondingProperty: PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] @@ -78,13 +78,13 @@ FILE fqName: fileName:/genericPropertyRef.kt CALL 'public final fun getValue (t: kotlin.Any?, p: kotlin.Any): kotlin.Int declared in .DVal' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD DELEGATE name:additionalText$delegate type:.DVal visibility:private [final,static] ' type=.DVal origin=null t: GET_VAR ': .Value.> declared in .' type=.Value.> origin=null - p: PROPERTY_REFERENCE 'public final additionalText: kotlin.Int [delegated,val] ' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty1<.Value.>, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE + p: PROPERTY_REFERENCE 'public final additionalText: kotlin.Int [delegated,val]' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty1<.Value.>, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE <1>: PROPERTY name:additionalValue visibility:public modality:FINAL [delegated,val] FIELD DELEGATE name:additionalValue$delegate type:.DVal visibility:private [final,static] EXPRESSION_BODY - CALL 'public constructor (kmember: kotlin.Any) [primary] declared in .DVal' type=.DVal origin=null - kmember: PROPERTY_REFERENCE 'public final value: T of .Value [var] ' field=null getter='public final fun (): T of .Value declared in .Value' setter='public final fun (: T of .Value): kotlin.Unit declared in .Value' type=kotlin.reflect.KMutableProperty1<.Value.>, T of .> origin=null + CONSTRUCTOR_CALL 'public constructor (kmember: kotlin.Any) [primary] declared in .DVal' type=.DVal origin=null + kmember: PROPERTY_REFERENCE 'public final value: T of .Value [var]' field=null getter='public final fun (): T of .Value declared in .Value' setter='public final fun (: T of .Value): kotlin.Unit declared in .Value' type=kotlin.reflect.KMutableProperty1<.Value.>, T of .> origin=null FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL ($receiver:.Value.>) returnType:kotlin.Int correspondingProperty: PROPERTY name:additionalValue visibility:public modality:FINAL [delegated,val] TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] @@ -94,7 +94,7 @@ FILE fqName: fileName:/genericPropertyRef.kt CALL 'public final fun getValue (t: kotlin.Any?, p: kotlin.Any): kotlin.Int declared in .DVal' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD DELEGATE name:additionalValue$delegate type:.DVal visibility:private [final,static] ' type=.DVal origin=null t: GET_VAR ': .Value.> declared in .' type=.Value.> origin=null - p: PROPERTY_REFERENCE 'public final additionalValue: kotlin.Int [delegated,val] ' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty1<.Value.>, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE + p: PROPERTY_REFERENCE 'public final additionalValue: kotlin.Int [delegated,val]' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty1<.Value.>, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE <1>: CLASS CLASS name:DVal modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DVal @@ -185,7 +185,7 @@ FILE fqName: fileName:/genericPropertyRef.kt PROPERTY name:barRef visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:barRef type:kotlin.reflect.KMutableProperty1 visibility:public [final,static] EXPRESSION_BODY - PROPERTY_REFERENCE 'public final bar: T of . [var] ' field=null getter='public final fun (): T of . declared in ' setter='public final fun (value: T of .): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty1 origin=null + PROPERTY_REFERENCE 'public final bar: T of . [var]' field=null getter='public final fun (): T of . declared in ' setter='public final fun (value: T of .): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty1 origin=null <1>: kotlin.String? FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KMutableProperty1 correspondingProperty: PROPERTY name:barRef visibility:public modality:FINAL [val] diff --git a/compiler/testData/ir/irText/expressions/kt16904.txt b/compiler/testData/ir/irText/expressions/kt16904.txt index ce95b89d5f6..2e61022da90 100644 --- a/compiler/testData/ir/irText/expressions/kt16904.txt +++ b/compiler/testData/ir/irText/expressions/kt16904.txt @@ -8,7 +8,7 @@ FILE fqName: fileName:/kt16904.kt PROPERTY name:x visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:x type:.B visibility:public [final] EXPRESSION_BODY - CALL 'public constructor () [primary] declared in .B' type=.B origin=null + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .B' type=.B origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:.B correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.A diff --git a/compiler/testData/ir/irText/expressions/kt16905.txt b/compiler/testData/ir/irText/expressions/kt16905.txt index 4137371f7e9..0f4018def51 100644 --- a/compiler/testData/ir/irText/expressions/kt16905.txt +++ b/compiler/testData/ir/irText/expressions/kt16905.txt @@ -83,5 +83,5 @@ FILE fqName: fileName:/kt16905.kt FUN name:test visibility:public modality:FINAL <> () returnType:.Outer.Inner BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test (): .Outer.Inner declared in ' - CALL 'public constructor () [primary] declared in .Outer.Inner' type=.Outer.Inner origin=null - $this: CALL 'public constructor () [primary] declared in .Outer' type=.Outer origin=null + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Outer.Inner' type=.Outer.Inner origin=null + $outer: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Outer' type=.Outer origin=null diff --git a/compiler/testData/ir/irText/expressions/memberTypeArguments.txt b/compiler/testData/ir/irText/expressions/memberTypeArguments.txt index 308ff4869d0..04ac079db62 100644 --- a/compiler/testData/ir/irText/expressions/memberTypeArguments.txt +++ b/compiler/testData/ir/irText/expressions/memberTypeArguments.txt @@ -23,8 +23,8 @@ FILE fqName: fileName:/memberTypeArguments.kt VALUE_PARAMETER name:newValue index:0 type:T of .GenericClass BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun withNewValue (newValue: T of .GenericClass): .GenericClass.GenericClass> declared in .GenericClass' - CALL 'public constructor (value: T of .GenericClass) [primary] declared in .GenericClass' type=.GenericClass.GenericClass> origin=null - : T of .GenericClass + CONSTRUCTOR_CALL 'public constructor (value: T of .GenericClass) [primary] declared in .GenericClass' type=.GenericClass.GenericClass> origin=null + : T of .GenericClass value: GET_VAR 'newValue: T of .GenericClass declared in .GenericClass.withNewValue' type=T of .GenericClass origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: diff --git a/compiler/testData/ir/irText/expressions/propertyReferences.txt b/compiler/testData/ir/irText/expressions/propertyReferences.txt index dbce494c0d7..c18fe253c35 100644 --- a/compiler/testData/ir/irText/expressions/propertyReferences.txt +++ b/compiler/testData/ir/irText/expressions/propertyReferences.txt @@ -100,7 +100,7 @@ FILE fqName: fileName:/propertyReferences.kt PROPERTY name:test_valWithBackingField visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test_valWithBackingField type:kotlin.reflect.KProperty0 visibility:public [final,static] EXPRESSION_BODY - PROPERTY_REFERENCE 'public final valWithBackingField: kotlin.Int [val] ' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty0 origin=null + PROPERTY_REFERENCE 'public final valWithBackingField: kotlin.Int [val]' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty0 origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KProperty0 correspondingProperty: PROPERTY name:test_valWithBackingField visibility:public modality:FINAL [val] BLOCK_BODY @@ -124,7 +124,7 @@ FILE fqName: fileName:/propertyReferences.kt PROPERTY name:test_varWithBackingField visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test_varWithBackingField type:kotlin.reflect.KMutableProperty0 visibility:public [final,static] EXPRESSION_BODY - PROPERTY_REFERENCE 'public final varWithBackingField: kotlin.Int [var] ' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=null + PROPERTY_REFERENCE 'public final varWithBackingField: kotlin.Int [var]' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KMutableProperty0 correspondingProperty: PROPERTY name:test_varWithBackingField visibility:public modality:FINAL [val] BLOCK_BODY @@ -148,7 +148,7 @@ FILE fqName: fileName:/propertyReferences.kt PROPERTY name:test_varWithBackingFieldAndAccessors visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test_varWithBackingFieldAndAccessors type:kotlin.reflect.KMutableProperty0 visibility:public [final,static] EXPRESSION_BODY - PROPERTY_REFERENCE 'public final varWithBackingFieldAndAccessors: kotlin.Int [var] ' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (value: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=null + PROPERTY_REFERENCE 'public final varWithBackingFieldAndAccessors: kotlin.Int [var]' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (value: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KMutableProperty0 correspondingProperty: PROPERTY name:test_varWithBackingFieldAndAccessors visibility:public modality:FINAL [val] BLOCK_BODY @@ -163,7 +163,7 @@ FILE fqName: fileName:/propertyReferences.kt PROPERTY name:test_valWithAccessors visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test_valWithAccessors type:kotlin.reflect.KProperty0 visibility:public [final,static] EXPRESSION_BODY - PROPERTY_REFERENCE 'public final valWithAccessors: kotlin.Int [val] ' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty0 origin=null + PROPERTY_REFERENCE 'public final valWithAccessors: kotlin.Int [val]' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty0 origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KProperty0 correspondingProperty: PROPERTY name:test_valWithAccessors visibility:public modality:FINAL [val] BLOCK_BODY @@ -182,7 +182,7 @@ FILE fqName: fileName:/propertyReferences.kt PROPERTY name:test_varWithAccessors visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test_varWithAccessors type:kotlin.reflect.KMutableProperty0 visibility:public [final,static] EXPRESSION_BODY - PROPERTY_REFERENCE 'public final varWithAccessors: kotlin.Int [var] ' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (value: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=null + PROPERTY_REFERENCE 'public final varWithAccessors: kotlin.Int [var]' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (value: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KMutableProperty0 correspondingProperty: PROPERTY name:test_varWithAccessors visibility:public modality:FINAL [val] BLOCK_BODY @@ -199,11 +199,11 @@ FILE fqName: fileName:/propertyReferences.kt CALL 'public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any): kotlin.Int declared in .Delegate' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD DELEGATE name:delegatedVal$delegate type:.Delegate visibility:private [final,static] ' type=.Delegate origin=null thisRef: CONST Null type=kotlin.Nothing? value=null - kProp: PROPERTY_REFERENCE 'public final delegatedVal: kotlin.Int [delegated,val] ' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE + kProp: PROPERTY_REFERENCE 'public final delegatedVal: kotlin.Int [delegated,val]' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE PROPERTY name:test_delegatedVal visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test_delegatedVal type:kotlin.reflect.KProperty0 visibility:public [final,static] EXPRESSION_BODY - PROPERTY_REFERENCE 'public final delegatedVal: kotlin.Int [delegated,val] ' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty0 origin=null + PROPERTY_REFERENCE 'public final delegatedVal: kotlin.Int [delegated,val]' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty0 origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KProperty0 correspondingProperty: PROPERTY name:test_delegatedVal visibility:public modality:FINAL [val] BLOCK_BODY @@ -220,7 +220,7 @@ FILE fqName: fileName:/propertyReferences.kt CALL 'public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any): kotlin.Int declared in .Delegate' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD DELEGATE name:delegatedVar$delegate type:.Delegate visibility:private [final,static] ' type=.Delegate origin=null thisRef: CONST Null type=kotlin.Nothing? value=null - kProp: PROPERTY_REFERENCE 'public final delegatedVar: kotlin.Int [delegated,var] ' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE + kProp: PROPERTY_REFERENCE 'public final delegatedVar: kotlin.Int [delegated,var]' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit correspondingProperty: PROPERTY name:delegatedVar visibility:public modality:FINAL [delegated,var] VALUE_PARAMETER name: index:0 type:kotlin.Int @@ -229,12 +229,12 @@ FILE fqName: fileName:/propertyReferences.kt CALL 'public final fun setValue (thisRef: kotlin.Any?, kProp: kotlin.Any, value: kotlin.Int): kotlin.Unit declared in .Delegate' type=kotlin.Unit origin=null $this: GET_FIELD 'FIELD DELEGATE name:delegatedVar$delegate type:.Delegate visibility:private [final,static] ' type=.Delegate origin=null thisRef: CONST Null type=kotlin.Nothing? value=null - kProp: PROPERTY_REFERENCE 'public final delegatedVar: kotlin.Int [delegated,var] ' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE + kProp: PROPERTY_REFERENCE 'public final delegatedVar: kotlin.Int [delegated,var]' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null PROPERTY name:test_delegatedVar visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test_delegatedVar type:kotlin.reflect.KMutableProperty0 visibility:public [final,static] EXPRESSION_BODY - PROPERTY_REFERENCE 'public final delegatedVar: kotlin.Int [delegated,var] ' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=null + PROPERTY_REFERENCE 'public final delegatedVar: kotlin.Int [delegated,var]' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KMutableProperty0 correspondingProperty: PROPERTY name:test_delegatedVar visibility:public modality:FINAL [val] BLOCK_BODY @@ -252,7 +252,7 @@ FILE fqName: fileName:/propertyReferences.kt PROPERTY name:test_constVal visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test_constVal type:kotlin.reflect.KProperty0 visibility:public [final,static] EXPRESSION_BODY - PROPERTY_REFERENCE 'public final constVal: kotlin.Int [val] ' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty0 origin=null + PROPERTY_REFERENCE 'public final constVal: kotlin.Int [val]' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty0 origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KProperty0 correspondingProperty: PROPERTY name:test_constVal visibility:public modality:FINAL [val] BLOCK_BODY @@ -261,7 +261,7 @@ FILE fqName: fileName:/propertyReferences.kt PROPERTY name:test_J_CONST visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test_J_CONST type:kotlin.reflect.KProperty0 visibility:public [final,static] EXPRESSION_BODY - PROPERTY_REFERENCE 'public final CONST: kotlin.Int [const,val] ' field='FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:CONST type:kotlin.Int visibility:public [final,static] ' getter=null setter=null type=kotlin.reflect.KProperty0 origin=null + PROPERTY_REFERENCE 'public final CONST: kotlin.Int [const,val]' field='FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:CONST type:kotlin.Int visibility:public [final,static] ' getter=null setter=null type=kotlin.reflect.KProperty0 origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KProperty0 correspondingProperty: PROPERTY name:test_J_CONST visibility:public modality:FINAL [val] BLOCK_BODY @@ -270,7 +270,7 @@ FILE fqName: fileName:/propertyReferences.kt PROPERTY name:test_J_nonConst visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test_J_nonConst type:kotlin.reflect.KMutableProperty0 visibility:public [final,static] EXPRESSION_BODY - PROPERTY_REFERENCE 'public final nonConst: kotlin.Int [var] ' field='FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:nonConst type:kotlin.Int visibility:public [static] ' getter=null setter=null type=kotlin.reflect.KMutableProperty0 origin=null + PROPERTY_REFERENCE 'public final nonConst: kotlin.Int [var]' field='FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:nonConst type:kotlin.Int visibility:public [static] ' getter=null setter=null type=kotlin.reflect.KMutableProperty0 origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KMutableProperty0 correspondingProperty: PROPERTY name:test_J_nonConst visibility:public modality:FINAL [val] BLOCK_BODY @@ -279,7 +279,7 @@ FILE fqName: fileName:/propertyReferences.kt PROPERTY name:test_varWithPrivateSet visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test_varWithPrivateSet type:kotlin.reflect.KProperty1<.C, kotlin.Int> visibility:public [final,static] EXPRESSION_BODY - PROPERTY_REFERENCE 'public final varWithPrivateSet: kotlin.Int [var] ' field=null getter='public final fun (): kotlin.Int declared in .C' setter=null type=kotlin.reflect.KProperty1<.C, kotlin.Int> origin=null + PROPERTY_REFERENCE 'public final varWithPrivateSet: kotlin.Int [var]' field=null getter='public final fun (): kotlin.Int declared in .C' setter=null type=kotlin.reflect.KProperty1<.C, kotlin.Int> origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KProperty1<.C, kotlin.Int> correspondingProperty: PROPERTY name:test_varWithPrivateSet visibility:public modality:FINAL [val] BLOCK_BODY @@ -288,7 +288,7 @@ FILE fqName: fileName:/propertyReferences.kt PROPERTY name:test_varWithProtectedSet visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test_varWithProtectedSet type:kotlin.reflect.KProperty1<.C, kotlin.Int> visibility:public [final,static] EXPRESSION_BODY - PROPERTY_REFERENCE 'public final varWithProtectedSet: kotlin.Int [var] ' field=null getter='public final fun (): kotlin.Int declared in .C' setter=null type=kotlin.reflect.KProperty1<.C, kotlin.Int> origin=null + PROPERTY_REFERENCE 'public final varWithProtectedSet: kotlin.Int [var]' field=null getter='public final fun (): kotlin.Int declared in .C' setter=null type=kotlin.reflect.KProperty1<.C, kotlin.Int> origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KProperty1<.C, kotlin.Int> correspondingProperty: PROPERTY name:test_varWithProtectedSet visibility:public modality:FINAL [val] BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/reflectionLiterals.txt b/compiler/testData/ir/irText/expressions/reflectionLiterals.txt index d9cc0ccf1df..627e889c563 100644 --- a/compiler/testData/ir/irText/expressions/reflectionLiterals.txt +++ b/compiler/testData/ir/irText/expressions/reflectionLiterals.txt @@ -73,7 +73,7 @@ FILE fqName: fileName:/reflectionLiterals.kt FIELD PROPERTY_BACKING_FIELD name:test5 type:kotlin.reflect.KFunction0 visibility:public [final,static] EXPRESSION_BODY FUNCTION_REFERENCE 'public final fun foo (): kotlin.Unit declared in .A' type=kotlin.reflect.KFunction0 origin=null - $this: CALL 'public constructor () [primary] declared in .A' type=.A origin=null + $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .A' type=.A origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction0 correspondingProperty: PROPERTY name:test5 visibility:public modality:FINAL [val] BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.txt b/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.txt index b0babfbfdc7..6aa740e5193 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.txt @@ -19,7 +19,7 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt GET_VAR 'a: kotlin.Function0 declared in .test2' type=kotlin.Function0 origin=null then: BLOCK type=kotlin.Unit origin=null CALL 'public open fun run1 (r: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null - $this: CALL 'public constructor () [primary] declared in .J' type=.J origin=null + $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .J' type=.J origin=null r: TYPE_OP type=java.lang.Runnable origin=IMPLICIT_CAST typeOperand=java.lang.Runnable GET_VAR 'a: kotlin.Function0 declared in .test2' type=kotlin.Function0 origin=null FUN name:test3 visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit @@ -31,7 +31,7 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=null then: BLOCK type=kotlin.Unit origin=null CALL 'public open fun run2 (r1: java.lang.Runnable?, r2: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null - $this: CALL 'public constructor () [primary] declared in .J' type=.J origin=null + $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .J' type=.J origin=null r1: TYPE_OP type=java.lang.Runnable origin=IMPLICIT_CAST typeOperand=java.lang.Runnable GET_VAR 'a: kotlin.Function0 declared in .test3' type=kotlin.Function0 origin=null r2: TYPE_OP type=java.lang.Runnable origin=IMPLICIT_CAST typeOperand=java.lang.Runnable @@ -46,7 +46,7 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null then: BLOCK type=kotlin.Unit origin=null CALL 'public open fun run2 (r1: java.lang.Runnable?, r2: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null - $this: CALL 'public constructor () [primary] declared in .J' type=.J origin=null + $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .J' type=.J origin=null r1: TYPE_OP type=java.lang.Runnable? origin=SAM_CONVERSION typeOperand=java.lang.Runnable? GET_VAR 'a: kotlin.Function0 declared in .test4' type=kotlin.Function0 origin=null r2: TYPE_OP type=java.lang.Runnable? origin=SAM_CONVERSION typeOperand=java.lang.Runnable? @@ -60,7 +60,7 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt GET_VAR 'a: kotlin.Any declared in .test5' type=kotlin.Any origin=null then: BLOCK type=kotlin.Unit origin=null CALL 'public open fun run1 (r: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null - $this: CALL 'public constructor () [primary] declared in .J' type=.J origin=null + $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .J' type=.J origin=null r: TYPE_OP type=java.lang.Runnable origin=IMPLICIT_CAST typeOperand=java.lang.Runnable GET_VAR 'a: kotlin.Any declared in .test5' type=kotlin.Any origin=null FUN name:test5x visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit @@ -75,7 +75,7 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt TYPE_OP type=kotlin.Function0 origin=CAST typeOperand=kotlin.Function0 GET_VAR 'a: kotlin.Any declared in .test5x' type=kotlin.Any origin=null CALL 'public open fun run1 (r: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null - $this: CALL 'public constructor () [primary] declared in .J' type=.J origin=null + $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .J' type=.J origin=null r: TYPE_OP type=java.lang.Runnable origin=IMPLICIT_CAST typeOperand=java.lang.Runnable GET_VAR 'a: kotlin.Any declared in .test5x' type=kotlin.Any origin=null FUN name:test6 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit @@ -85,7 +85,7 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt TYPE_OP type=kotlin.Function0 origin=CAST typeOperand=kotlin.Function0 GET_VAR 'a: kotlin.Any declared in .test6' type=kotlin.Any origin=null CALL 'public open fun run1 (r: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null - $this: CALL 'public constructor () [primary] declared in .J' type=.J origin=null + $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .J' type=.J origin=null r: TYPE_OP type=java.lang.Runnable? origin=SAM_CONVERSION typeOperand=java.lang.Runnable? TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 GET_VAR 'a: kotlin.Any declared in .test6' type=kotlin.Any origin=null @@ -96,7 +96,7 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt TYPE_OP type=kotlin.Function0 origin=CAST typeOperand=kotlin.Function0 GET_VAR 'a: kotlin.Function1 declared in .test7' type=kotlin.Function1 origin=null CALL 'public open fun run1 (r: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null - $this: CALL 'public constructor () [primary] declared in .J' type=.J origin=null + $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .J' type=.J origin=null r: TYPE_OP type=java.lang.Runnable? origin=SAM_CONVERSION typeOperand=java.lang.Runnable? TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 GET_VAR 'a: kotlin.Function1 declared in .test7' type=kotlin.Function1 origin=null @@ -104,7 +104,7 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt VALUE_PARAMETER name:a index:0 type:kotlin.Function0 BLOCK_BODY CALL 'public open fun run1 (r: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null - $this: CALL 'public constructor () [primary] declared in .J' type=.J origin=null + $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .J' type=.J origin=null r: TYPE_OP type=java.lang.Runnable? origin=SAM_CONVERSION typeOperand=java.lang.Runnable? CALL 'public open fun id (x: T of .J.id?): T of .J.id? declared in .J' type=kotlin.Function0? origin=null : kotlin.Function0? @@ -112,6 +112,6 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt FUN name:test9 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public open fun run1 (r: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null - $this: CALL 'public constructor () [primary] declared in .J' type=.J origin=null + $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .J' type=.J origin=null r: TYPE_OP type=java.lang.Runnable? origin=SAM_CONVERSION typeOperand=java.lang.Runnable? FUNCTION_REFERENCE 'public final fun test9 (): kotlin.Unit declared in ' type=kotlin.reflect.KFunction0 origin=null diff --git a/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.txt b/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.txt index 444936aedcb..a634e15bd92 100644 --- a/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.txt +++ b/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.txt @@ -34,6 +34,6 @@ FILE fqName: fileName:/specializedTypeAliasConstructorCall.kt FUN name:test visibility:public modality:FINAL <> () returnType:.Cell BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test (): .Cell declared in ' - CALL 'public constructor (value: T of .Cell) [primary] declared in .Cell' type=.Cell origin=null - : kotlin.Int + CONSTRUCTOR_CALL 'public constructor (value: T of .Cell) [primary] declared in .Cell' type=.Cell origin=null + : kotlin.Int value: CONST Int type=kotlin.Int value=42 diff --git a/compiler/testData/ir/irText/expressions/throw.txt b/compiler/testData/ir/irText/expressions/throw.txt index 1e28f881208..4438ccbd32b 100644 --- a/compiler/testData/ir/irText/expressions/throw.txt +++ b/compiler/testData/ir/irText/expressions/throw.txt @@ -2,7 +2,7 @@ FILE fqName: fileName:/throw.kt FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY THROW type=kotlin.Nothing - CALL 'public constructor () declared in kotlin.Throwable' type=kotlin.Throwable origin=null + CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Throwable' type=kotlin.Throwable origin=null FUN name:testImplicitCast visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any BLOCK_BODY diff --git a/compiler/testData/ir/irText/regressions/coercionInLoop.txt b/compiler/testData/ir/irText/regressions/coercionInLoop.txt index bc9a4aaf861..ded62cb0936 100644 --- a/compiler/testData/ir/irText/regressions/coercionInLoop.txt +++ b/compiler/testData/ir/irText/regressions/coercionInLoop.txt @@ -2,7 +2,7 @@ FILE fqName: fileName:/coercionInLoop.kt FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY VAR name:a type:kotlin.DoubleArray [val] - CALL 'public constructor (size: kotlin.Int) [primary] declared in kotlin.DoubleArray' type=kotlin.DoubleArray origin=null + CONSTRUCTOR_CALL 'public constructor (size: kotlin.Int) [primary] declared in kotlin.DoubleArray' type=kotlin.DoubleArray origin=null size: CONST Int type=kotlin.Int value=5 VAR name:x type:kotlin.collections.DoubleIterator [val] CALL 'public final fun iterator (): kotlin.collections.DoubleIterator declared in kotlin.DoubleArray' type=kotlin.collections.DoubleIterator origin=null diff --git a/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.txt b/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.txt index a7b315ff63e..0b0f11a6f16 100644 --- a/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.txt +++ b/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.txt @@ -34,10 +34,10 @@ FILE fqName: fileName:/typeAliasCtorForGenericClass.kt FUN name:bar visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:b type:.A [val] - CALL 'public constructor (q: Q of .A) [primary] declared in .A' type=.A origin=null - : kotlin.Int + CONSTRUCTOR_CALL 'public constructor (q: Q of .A) [primary] declared in .A' type=.A origin=null + : kotlin.Int q: CONST Int type=kotlin.Int value=2 VAR name:b2 type:.A<.A> [val] - CALL 'public constructor (q: Q of .A) [primary] declared in .A' type=.A<.A> origin=null - : .A + CONSTRUCTOR_CALL 'public constructor (q: Q of .A) [primary] declared in .A' type=.A<.A> origin=null + : .A q: GET_VAR 'val b: .A [val] declared in .bar' type=.A origin=null diff --git a/compiler/testData/ir/irText/stubs/builtinMap.txt b/compiler/testData/ir/irText/stubs/builtinMap.txt index 53eaf4cb284..197283d4f0f 100644 --- a/compiler/testData/ir/irText/stubs/builtinMap.txt +++ b/compiler/testData/ir/irText/stubs/builtinMap.txt @@ -18,9 +18,9 @@ FILE fqName: fileName:/builtinMap.kt if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun apply (block: @[CALL 'public constructor () [primary] declared in kotlin.ExtensionFunctionType' type=kotlin.ExtensionFunctionType origin=null] kotlin.Function1): T of kotlin.apply [inline] declared in kotlin' type=java.util.LinkedHashMap.plus?, V1 of .plus?> origin=null : java.util.LinkedHashMap.plus?, V1 of .plus?> - $receiver: CALL 'public constructor (p0: kotlin.collections.Map?) declared in java.util.LinkedHashMap' type=java.util.LinkedHashMap.plus?, V1 of .plus?> origin=null - : K1 of .plus? - : V1 of .plus? + $receiver: CONSTRUCTOR_CALL 'public constructor (p0: kotlin.collections.Map?) declared in java.util.LinkedHashMap' type=java.util.LinkedHashMap.plus?, V1 of .plus?> origin=null + : K1 of .plus? + : V1 of .plus? p0: GET_VAR ': kotlin.collections.Map.plus, V1 of .plus> declared in .plus' type=kotlin.collections.Map.plus, V1 of .plus> origin=null block: BLOCK type=@[CALL 'public constructor () [primary] declared in kotlin.ExtensionFunctionType' type=kotlin.ExtensionFunctionType origin=null] kotlin.Function1.plus?, V1 of .plus?>, kotlin.Unit> origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:java.util.LinkedHashMap.plus?, V1 of .plus?>) returnType:kotlin.Unit diff --git a/compiler/testData/ir/irText/stubs/javaInnerClass.txt b/compiler/testData/ir/irText/stubs/javaInnerClass.txt index 1ca41866738..ef84c9f48fa 100644 --- a/compiler/testData/ir/irText/stubs/javaInnerClass.txt +++ b/compiler/testData/ir/irText/stubs/javaInnerClass.txt @@ -8,8 +8,8 @@ FILE fqName: fileName:/javaInnerClass.kt PROPERTY name:test visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test type:.J.JInner visibility:public [final] EXPRESSION_BODY - CALL 'public constructor () [primary] declared in .J.JInner' type=.J.JInner origin=null - $this: GET_VAR ': .Test1 declared in .Test1' type=.Test1 origin=null + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .J.JInner' type=.J.JInner origin=null + $outer: GET_VAR ': .Test1 declared in .Test1' type=.Test1 origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test1) returnType:.J.JInner correspondingProperty: PROPERTY name:test visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.Test1 diff --git a/compiler/testData/ir/irText/stubs/javaSyntheticProperty.txt b/compiler/testData/ir/irText/stubs/javaSyntheticProperty.txt index 0acb4277c1a..5ba8636b563 100644 --- a/compiler/testData/ir/irText/stubs/javaSyntheticProperty.txt +++ b/compiler/testData/ir/irText/stubs/javaSyntheticProperty.txt @@ -3,7 +3,7 @@ FILE fqName: fileName:/javaSyntheticProperty.kt FIELD PROPERTY_BACKING_FIELD name:test type:kotlin.String? visibility:public [final,static] EXPRESSION_BODY CALL 'public open fun getFoo (): kotlin.String? declared in .J' type=kotlin.String? origin=GET_PROPERTY - $this: CALL 'public/*package*/ constructor () [primary] declared in .J' type=.J origin=null + $this: CONSTRUCTOR_CALL 'public/*package*/ constructor () [primary] declared in .J' type=.J origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String? correspondingProperty: PROPERTY name:test visibility:public modality:FINAL [val] BLOCK_BODY diff --git a/compiler/testData/ir/irText/types/intersectionType1.txt b/compiler/testData/ir/irText/types/intersectionType1.txt index 97e042a1a18..69dba2112e1 100644 --- a/compiler/testData/ir/irText/types/intersectionType1.txt +++ b/compiler/testData/ir/irText/types/intersectionType1.txt @@ -55,14 +55,14 @@ FILE fqName: fileName:/intersectionType1.kt CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array [inline] declared in kotlin' type=kotlin.Array<.In> origin=null : .In elements: VARARG type=kotlin.Array.In> varargElementType=.In - CALL 'public constructor () [primary] declared in .In' type=.In origin=null - : kotlin.Int + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .In' type=.In origin=null + : kotlin.Int VAR name:a2 type:kotlin.Array<.In> [val] CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array [inline] declared in kotlin' type=kotlin.Array<.In> origin=null : .In elements: VARARG type=kotlin.Array.In> varargElementType=.In - CALL 'public constructor () [primary] declared in .In' type=.In origin=null - : kotlin.String + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .In' type=.In origin=null + : kotlin.String TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit CALL 'public final fun foo (a: kotlin.Array<.In.foo>>, b: kotlin.Array<.In>): kotlin.Boolean declared in ' type=kotlin.Boolean origin=null : kotlin.Int diff --git a/compiler/testData/ir/irText/types/intersectionType2.txt b/compiler/testData/ir/irText/types/intersectionType2.txt index 2bf3735d43d..c9a5fffa4ec 100644 --- a/compiler/testData/ir/irText/types/intersectionType2.txt +++ b/compiler/testData/ir/irText/types/intersectionType2.txt @@ -90,9 +90,9 @@ FILE fqName: fileName:/intersectionType2.kt FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Any BLOCK_BODY VAR name:mm type:.B [val] - CALL 'public constructor () [primary] declared in .B' type=.B origin=null + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .B' type=.B origin=null VAR name:nn type:.C [val] - CALL 'public constructor () [primary] declared in .C' type=.C origin=null + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .C' type=.C origin=null VAR name:c type:kotlin.Any [val] WHEN type=kotlin.Any origin=IF BRANCH diff --git a/compiler/testData/ir/sourceRanges/augmentedAssignmentWithExpression.txt b/compiler/testData/ir/sourceRanges/augmentedAssignmentWithExpression.txt index 4fac0acf532..3b70d9c222e 100644 --- a/compiler/testData/ir/sourceRanges/augmentedAssignmentWithExpression.txt +++ b/compiler/testData/ir/sourceRanges/augmentedAssignmentWithExpression.txt @@ -25,7 +25,7 @@ @10:0..18 FUN name:foo visibility:public modality:FINAL <> () returnType:test.Host @10:12..18 BLOCK_BODY @10:12..18 RETURN type=kotlin.Nothing from='public final fun foo (): test.Host declared in test' - @10:12..18 CALL 'public constructor () [primary] declared in test.Host' type=test.Host origin=null + @10:12..18 CONSTRUCTOR_CALL 'public constructor () [primary] declared in test.Host' type=test.Host origin=null @12:0..14:1 FUN name:test2 visibility:public modality:FINAL <> ($receiver:test.Host) returnType:kotlin.Unit @12:4..8 VALUE_PARAMETER name: type:test.Host @12:17..14:1 BLOCK_BODY diff --git a/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java b/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java index 29cca64d1f5..31810f75a69 100644 --- a/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java @@ -802,6 +802,11 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase { runTest("compiler/testData/ir/irText/expressions/complexAugmentedAssignment.kt"); } + @TestMetadata("constructorWithOwnTypeParametersCall.kt") + public void testConstructorWithOwnTypeParametersCall() throws Exception { + runTest("compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.kt"); + } + @TestMetadata("contructorCall.kt") public void testContructorCall() throws Exception { runTest("compiler/testData/ir/irText/expressions/contructorCall.kt");