From 28b3ea27f3a4dcfed6bda57ca8bcc899e3e6434a Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Mon, 5 Sep 2016 09:20:09 +0300 Subject: [PATCH] Generate explicit call to 'Any()' if no superclass found. Generate call super-constructor calls as IrDelegatedConstructorCall. --- .../kotlin/psi2ir/generators/BodyGenerator.kt | 28 +++++++++++++------ .../IrDelegatingConstructorCall.kt | 3 +- .../kotlin/ir/expressions/IrOperator.kt | 1 - ...tReorderingInDelegatingConstructorCall.txt | 17 ++++++----- .../ir/irText/classes/classMembers.txt | 3 ++ .../testData/ir/irText/classes/classes.txt | 3 ++ .../ir/irText/classes/companionObject.txt | 4 +++ .../ir/irText/classes/dataClasses.txt | 1 + .../classes/delegatedImplementation.txt | 4 +++ ...atedImplementationWithExplicitOverride.txt | 2 ++ ...onstructorCallsInSecondaryConstructors.txt | 1 + .../testData/ir/irText/classes/initBlock.kt | 12 ++++++++ .../testData/ir/irText/classes/initBlock.txt | 20 +++++++++++++ .../testData/ir/irText/classes/initVal.txt | 3 ++ .../testData/ir/irText/classes/initVar.txt | 4 +++ .../testData/ir/irText/classes/innerClass.kt | 5 ++++ .../testData/ir/irText/classes/innerClass.txt | 17 +++++++++++ .../ir/irText/classes/localClasses.txt | 1 + .../classes/objectLiteralExpressions.txt | 8 ++++-- .../irText/classes/objectWithInitializers.txt | 3 +- .../ir/irText/classes/primaryConstructor.txt | 3 ++ ...aryConstructorWithSuperConstructorCall.txt | 7 +++-- .../ir/irText/classes/qualifiedSuperCalls.txt | 1 + .../ir/irText/classes/sealedClasses.txt | 7 +++-- ...nstructorWithInitializersFromClassBody.txt | 1 + .../testData/ir/irText/classes/superCalls.txt | 3 +- .../declarations/delegatedProperties.txt | 1 + .../ir/irText/declarations/typeAlias.txt | 1 + .../expressions/arrayAugmentedAssignment1.txt | 1 + .../ir/irText/expressions/assignments.txt | 1 + .../expressions/augmentedAssignment2.txt | 1 + .../irText/expressions/chainOfSafeCalls.txt | 1 + .../expressions/forWithImplicitReceivers.txt | 2 ++ .../expressions/jvmStaticFieldReference.txt | 1 + .../irText/expressions/reflectionLiterals.txt | 1 + .../safeCallWithIncrementDecrement.txt | 1 + .../ir/irText/expressions/safeCalls.txt | 1 + .../testData/ir/irText/expressions/values.txt | 3 ++ .../testData/ir/irText/expressions/when.txt | 1 + .../lambdas/multipleImplicitReceivers.txt | 2 ++ .../kotlin/ir/IrTextTestCaseGenerated.java | 6 ++++ 41 files changed, 156 insertions(+), 30 deletions(-) create mode 100644 compiler/testData/ir/irText/classes/innerClass.kt create mode 100644 compiler/testData/ir/irText/classes/innerClass.txt diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/BodyGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/BodyGenerator.kt index 06bfc60293f..87d9340213b 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/BodyGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/BodyGenerator.kt @@ -24,6 +24,7 @@ import org.jetbrains.kotlin.psi.* import org.jetbrains.kotlin.psi.psiUtil.endOffset import org.jetbrains.kotlin.psi.psiUtil.startOffset import org.jetbrains.kotlin.resolve.BindingContext +import org.jetbrains.kotlin.resolve.descriptorUtil.getSuperClassOrAny import java.lang.AssertionError import java.util.* @@ -177,16 +178,27 @@ class BodyGenerator(val scopeOwner: DeclarationDescriptor, override val context: irBlockBody.addStatement(generateEnumEntrySuperConstructorCall(ktClassOrObject as KtEnumEntry, classDescriptor)) } else -> { - val ktSuperTypeList = ktClassOrObject.getSuperTypeList() ?: return - for (ktSuperTypeListEntry in ktSuperTypeList.entries) { - if (ktSuperTypeListEntry is KtSuperTypeCallEntry) { - val statementGenerator = createStatementGenerator() - val superConstructorCall = statementGenerator.pregenerateCall(getResolvedCall(ktSuperTypeListEntry)!!) - val irSuperConstructorCall = CallGenerator(statementGenerator).generateCall( - ktSuperTypeListEntry, superConstructorCall, IrOperator.SUPER_CONSTRUCTOR_CALL) - irBlockBody.addStatement(irSuperConstructorCall) + val statementGenerator = createStatementGenerator() + + ktClassOrObject.getSuperTypeList()?.let { ktSuperTypeList -> + for (ktSuperTypeListEntry in ktSuperTypeList.entries) { + if (ktSuperTypeListEntry is KtSuperTypeCallEntry) { + val superConstructorCall = statementGenerator.pregenerateCall(getResolvedCall(ktSuperTypeListEntry)!!) + val irSuperConstructorCall = CallGenerator(statementGenerator).generateDelegatingConstructorCall( + ktSuperTypeListEntry.startOffset, ktSuperTypeListEntry.endOffset, superConstructorCall) + irBlockBody.addStatement(irSuperConstructorCall) + return + } } } + + // If we are here, we didn't find a superclass entry in super types. + // Thus, super class should be Any. + val superClass = classDescriptor.getSuperClassOrAny() + assert(KotlinBuiltIns.isAny(superClass)) { "$classDescriptor: Super class should be any: $superClass" } + val superConstructor = superClass.constructors.single() + irBlockBody.addStatement(IrDelegatingConstructorCallImpl(ktClassOrObject.startOffset, ktClassOrObject.endOffset, + superConstructor)) } } } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrDelegatingConstructorCall.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrDelegatingConstructorCall.kt index 4f71a036daf..002c4441467 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrDelegatingConstructorCall.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrDelegatingConstructorCall.kt @@ -18,7 +18,6 @@ package org.jetbrains.kotlin.ir.expressions import org.jetbrains.kotlin.descriptors.ConstructorDescriptor import org.jetbrains.kotlin.ir.visitors.IrElementVisitor -import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns interface IrDelegatingConstructorCall : IrGeneralCall { override val descriptor: ConstructorDescriptor @@ -28,7 +27,7 @@ class IrDelegatingConstructorCallImpl( startOffset: Int, endOffset: Int, override val descriptor: ConstructorDescriptor -) : IrGeneralCallBase(startOffset, endOffset, descriptor.builtIns.unitType, descriptor.valueParameters.size), IrDelegatingConstructorCall { +) : IrGeneralCallBase(startOffset, endOffset, descriptor.returnType, descriptor.valueParameters.size), IrDelegatingConstructorCall { override fun accept(visitor: IrElementVisitor, data: D): R { return visitor.visitDelegatingConstructorCall(this, data) } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrOperator.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrOperator.kt index ee6f8df736c..4dbae585eae 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrOperator.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrOperator.kt @@ -89,7 +89,6 @@ interface IrOperator { object ANONYMOUS_FUNCTION : IrOperatorImpl("ANONYMOUS_FUNCTION") object OBJECT_LITERAL : IrOperatorImpl("OBJECT_LITERAL") - object SUPER_CONSTRUCTOR_CALL : IrOperatorImpl("SUPER_CONSTRUCTOR_CALL") object INITIALIZE_PROPERTY_FROM_PARAMETER : IrOperatorImpl("INITIALIZE_PROPERTY_FROM_PARAMETER") object PROPERTY_REFERENCE_FOR_DELEGATE : IrOperatorImpl("PROPERTY_REFERENCE_FOR_DELEGATE") diff --git a/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.txt b/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.txt index f7514ac3198..2b1927edcd6 100644 --- a/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.txt +++ b/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.txt @@ -2,6 +2,7 @@ FILE /argumentReorderingInDelegatingConstructorCall.kt CLASS CLASS Base CONSTRUCTOR public constructor Base(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.Int) BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any SET_BACKING_FIELD x type=kotlin.Unit operator=null GET_VAR x type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER SET_BACKING_FIELD y type=kotlin.Unit operator=null @@ -21,7 +22,7 @@ FILE /argumentReorderingInDelegatingConstructorCall.kt GET_VAR yy type=kotlin.Int operator=null VAR val tmp1_x: kotlin.Int GET_VAR xx type=kotlin.Int operator=null - CALL . type=Base operator=SUPER_CONSTRUCTOR_CALL + DELEGATING_CONSTRUCTOR_CALL Base x: GET_VAR tmp1_x type=kotlin.Int operator=null y: GET_VAR tmp0_y type=kotlin.Int operator=null INSTANCE_INITIALIZER_CALL classDescriptor=Test1 @@ -33,10 +34,9 @@ FILE /argumentReorderingInDelegatingConstructorCall.kt GET_VAR yy type=kotlin.Int operator=null VAR val tmp1_x: kotlin.Int GET_VAR xx type=kotlin.Int operator=null - TYPE_OP operator=IMPLICIT_CAST typeOperand=Base - DELEGATING_CONSTRUCTOR_CALL Base - x: GET_VAR tmp1_x type=kotlin.Int operator=null - y: GET_VAR tmp0_y type=kotlin.Int operator=null + DELEGATING_CONSTRUCTOR_CALL Base + x: GET_VAR tmp1_x type=kotlin.Int operator=null + y: GET_VAR tmp0_y type=kotlin.Int operator=null INSTANCE_INITIALIZER_CALL classDescriptor=Test2 CONSTRUCTOR public constructor Test2(/*0*/ xxx: kotlin.Int, /*1*/ yyy: kotlin.Int, /*2*/ a: kotlin.Any) BLOCK_BODY @@ -45,7 +45,6 @@ FILE /argumentReorderingInDelegatingConstructorCall.kt GET_VAR yyy type=kotlin.Int operator=null VAR val tmp1_xx: kotlin.Int GET_VAR xxx type=kotlin.Int operator=null - TYPE_OP operator=IMPLICIT_CAST typeOperand=Test2 - DELEGATING_CONSTRUCTOR_CALL Test2 - xx: GET_VAR tmp1_xx type=kotlin.Int operator=null - yy: GET_VAR tmp0_yy type=kotlin.Int operator=null + DELEGATING_CONSTRUCTOR_CALL Test2 + xx: GET_VAR tmp1_xx type=kotlin.Int operator=null + yy: GET_VAR tmp0_yy type=kotlin.Int operator=null diff --git a/compiler/testData/ir/irText/classes/classMembers.txt b/compiler/testData/ir/irText/classes/classMembers.txt index cacede6ab8a..e6d757a3e68 100644 --- a/compiler/testData/ir/irText/classes/classMembers.txt +++ b/compiler/testData/ir/irText/classes/classMembers.txt @@ -4,6 +4,7 @@ FILE /classMembers.kt z: EXPRESSION_BODY CONST Int type=kotlin.Int value='1' BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any SET_BACKING_FIELD y type=kotlin.Unit operator=null GET_VAR y type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER SET_BACKING_FIELD z type=kotlin.Unit operator=null @@ -51,6 +52,7 @@ FILE /classMembers.kt CLASS CLASS NestedClass CONSTRUCTOR public constructor NestedClass() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=NestedClass FUN public final fun function(): kotlin.Unit BLOCK_BODY @@ -70,4 +72,5 @@ FILE /classMembers.kt CLASS OBJECT Companion CONSTRUCTOR private constructor Companion() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=Companion diff --git a/compiler/testData/ir/irText/classes/classes.txt b/compiler/testData/ir/irText/classes/classes.txt index f27de0670e0..39b4cef07ee 100644 --- a/compiler/testData/ir/irText/classes/classes.txt +++ b/compiler/testData/ir/irText/classes/classes.txt @@ -2,15 +2,18 @@ FILE /classes.kt CLASS CLASS TestClass CONSTRUCTOR public constructor TestClass() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=TestClass CLASS INTERFACE TestInterface CLASS OBJECT TestObject CONSTRUCTOR private constructor TestObject() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=TestObject CLASS ANNOTATION_CLASS TestAnnotationClass CONSTRUCTOR public constructor TestAnnotationClass() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=TestAnnotationClass CLASS ENUM_CLASS TestEnumClass CONSTRUCTOR private constructor TestEnumClass() diff --git a/compiler/testData/ir/irText/classes/companionObject.txt b/compiler/testData/ir/irText/classes/companionObject.txt index f0ffc85c217..5591b2a89bc 100644 --- a/compiler/testData/ir/irText/classes/companionObject.txt +++ b/compiler/testData/ir/irText/classes/companionObject.txt @@ -2,16 +2,20 @@ FILE /companionObject.kt CLASS CLASS Test1 CONSTRUCTOR public constructor Test1() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=Test1 CLASS OBJECT Companion CONSTRUCTOR private constructor Companion() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=Companion CLASS CLASS Test2 CONSTRUCTOR public constructor Test2() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=Test2 CLASS OBJECT Named CONSTRUCTOR private constructor Named() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=Named diff --git a/compiler/testData/ir/irText/classes/dataClasses.txt b/compiler/testData/ir/irText/classes/dataClasses.txt index f078977c01a..07fb57d4a57 100644 --- a/compiler/testData/ir/irText/classes/dataClasses.txt +++ b/compiler/testData/ir/irText/classes/dataClasses.txt @@ -2,6 +2,7 @@ FILE /dataClasses.kt CLASS CLASS Test1 CONSTRUCTOR public constructor Test1(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.String, /*2*/ z: kotlin.Any) BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any SET_BACKING_FIELD x type=kotlin.Unit operator=null GET_VAR x type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER SET_BACKING_FIELD y type=kotlin.Unit operator=null diff --git a/compiler/testData/ir/irText/classes/delegatedImplementation.txt b/compiler/testData/ir/irText/classes/delegatedImplementation.txt index abad07840a8..3542172e15d 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementation.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementation.txt @@ -6,6 +6,7 @@ FILE /delegatedImplementation.kt CLASS OBJECT BaseImpl CONSTRUCTOR private constructor BaseImpl() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=BaseImpl FUN public open override /*1*/ fun foo(/*0*/ x: kotlin.Int, /*1*/ s: kotlin.String): kotlin.Unit BLOCK_BODY @@ -27,6 +28,7 @@ FILE /delegatedImplementation.kt CLASS CLASS CONSTRUCTOR public constructor () BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor= PROPERTY public open override /*1*/ val x: kotlin.String EXPRESSION_BODY @@ -50,6 +52,7 @@ FILE /delegatedImplementation.kt CLASS CLASS Test1 CONSTRUCTOR public constructor Test1() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=Test1 PROPERTY val `Test1$IBase$delegate`: BaseImpl EXPRESSION_BODY @@ -73,6 +76,7 @@ FILE /delegatedImplementation.kt CLASS CLASS Test2 CONSTRUCTOR public constructor Test2() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=Test2 PROPERTY val `Test2$IBase$delegate`: BaseImpl EXPRESSION_BODY diff --git a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.txt b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.txt index 1c89217f3db..c742f0d7ae7 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.txt @@ -5,6 +5,7 @@ FILE /delegatedImplementationWithExplicitOverride.kt CLASS OBJECT FooBarImpl CONSTRUCTOR private constructor FooBarImpl() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=FooBarImpl FUN public open override /*1*/ fun foo(): kotlin.Unit BLOCK_BODY @@ -13,6 +14,7 @@ FILE /delegatedImplementationWithExplicitOverride.kt CLASS CLASS C CONSTRUCTOR public constructor C() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=C PROPERTY val `C$IFooBar$delegate`: FooBarImpl EXPRESSION_BODY diff --git a/compiler/testData/ir/irText/classes/delegatingConstructorCallsInSecondaryConstructors.txt b/compiler/testData/ir/irText/classes/delegatingConstructorCallsInSecondaryConstructors.txt index 13fe4f4a6c1..364c094f76b 100644 --- a/compiler/testData/ir/irText/classes/delegatingConstructorCallsInSecondaryConstructors.txt +++ b/compiler/testData/ir/irText/classes/delegatingConstructorCallsInSecondaryConstructors.txt @@ -2,6 +2,7 @@ FILE /delegatingConstructorCallsInSecondaryConstructors.kt CLASS CLASS Base CONSTRUCTOR public constructor Base() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=Base CLASS CLASS Test CONSTRUCTOR public constructor Test() diff --git a/compiler/testData/ir/irText/classes/initBlock.kt b/compiler/testData/ir/irText/classes/initBlock.kt index f6c5d646e12..22761236e4a 100644 --- a/compiler/testData/ir/irText/classes/initBlock.kt +++ b/compiler/testData/ir/irText/classes/initBlock.kt @@ -28,4 +28,16 @@ class Test4 { init { println("2") } +} + +class Test5 { + init { + println("1") + } + + inner class TestInner { + init { + println("2") + } + } } \ No newline at end of file diff --git a/compiler/testData/ir/irText/classes/initBlock.txt b/compiler/testData/ir/irText/classes/initBlock.txt index 6862c75b19f..303381dcf91 100644 --- a/compiler/testData/ir/irText/classes/initBlock.txt +++ b/compiler/testData/ir/irText/classes/initBlock.txt @@ -2,6 +2,7 @@ FILE /initBlock.kt CLASS CLASS Test1 CONSTRUCTOR public constructor Test1() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=Test1 ANONYMOUS_INITIALIZER Test1 BLOCK_BODY @@ -9,6 +10,7 @@ FILE /initBlock.kt CLASS CLASS Test2 CONSTRUCTOR public constructor Test2(/*0*/ x: kotlin.Int) BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any SET_BACKING_FIELD x type=kotlin.Unit operator=null GET_VAR x type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER INSTANCE_INITIALIZER_CALL classDescriptor=Test2 @@ -39,3 +41,21 @@ FILE /initBlock.kt BLOCK_BODY CALL .println type=kotlin.Unit operator=null message: CONST String type=kotlin.String value='2' + CLASS CLASS Test5 + CONSTRUCTOR public constructor Test5() + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any + INSTANCE_INITIALIZER_CALL classDescriptor=Test5 + ANONYMOUS_INITIALIZER Test5 + BLOCK_BODY + CALL .println type=kotlin.Unit operator=null + message: CONST String type=kotlin.String value='1' + CLASS CLASS TestInner + CONSTRUCTOR public constructor TestInner() + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any + INSTANCE_INITIALIZER_CALL classDescriptor=TestInner + ANONYMOUS_INITIALIZER TestInner + BLOCK_BODY + CALL .println type=kotlin.Unit operator=null + message: CONST String type=kotlin.String value='2' diff --git a/compiler/testData/ir/irText/classes/initVal.txt b/compiler/testData/ir/irText/classes/initVal.txt index e4739db70c1..fa24906b30f 100644 --- a/compiler/testData/ir/irText/classes/initVal.txt +++ b/compiler/testData/ir/irText/classes/initVal.txt @@ -2,6 +2,7 @@ FILE /initVal.kt CLASS CLASS TestInitValFromParameter CONSTRUCTOR public constructor TestInitValFromParameter(/*0*/ x: kotlin.Int) BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any SET_BACKING_FIELD x type=kotlin.Unit operator=null GET_VAR x type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER INSTANCE_INITIALIZER_CALL classDescriptor=TestInitValFromParameter @@ -11,6 +12,7 @@ FILE /initVal.kt CLASS CLASS TestInitValInClass CONSTRUCTOR public constructor TestInitValInClass() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=TestInitValInClass PROPERTY public final val x: kotlin.Int = 0 EXPRESSION_BODY @@ -18,6 +20,7 @@ FILE /initVal.kt CLASS CLASS TestInitValInInitBlock CONSTRUCTOR public constructor TestInitValInInitBlock() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=TestInitValInInitBlock PROPERTY public final val x: kotlin.Int ANONYMOUS_INITIALIZER TestInitValInInitBlock diff --git a/compiler/testData/ir/irText/classes/initVar.txt b/compiler/testData/ir/irText/classes/initVar.txt index dd95cc69327..512e855c741 100644 --- a/compiler/testData/ir/irText/classes/initVar.txt +++ b/compiler/testData/ir/irText/classes/initVar.txt @@ -2,6 +2,7 @@ FILE /initVar.kt CLASS CLASS TestInitVarFromParameter CONSTRUCTOR public constructor TestInitVarFromParameter(/*0*/ x: kotlin.Int) BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any SET_BACKING_FIELD x type=kotlin.Unit operator=null GET_VAR x type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER INSTANCE_INITIALIZER_CALL classDescriptor=TestInitVarFromParameter @@ -11,6 +12,7 @@ FILE /initVar.kt CLASS CLASS TestInitVarInClass CONSTRUCTOR public constructor TestInitVarInClass() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=TestInitVarInClass PROPERTY public final var x: kotlin.Int EXPRESSION_BODY @@ -18,6 +20,7 @@ FILE /initVar.kt CLASS CLASS TestInitVarInInitBlock CONSTRUCTOR public constructor TestInitVarInInitBlock() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=TestInitVarInInitBlock PROPERTY public final var x: kotlin.Int ANONYMOUS_INITIALIZER TestInitVarInInitBlock @@ -28,6 +31,7 @@ FILE /initVar.kt CLASS CLASS TestInitVarWithCustomSetter CONSTRUCTOR public constructor TestInitVarWithCustomSetter() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=TestInitVarWithCustomSetter PROPERTY public final var x: kotlin.Int EXPRESSION_BODY diff --git a/compiler/testData/ir/irText/classes/innerClass.kt b/compiler/testData/ir/irText/classes/innerClass.kt new file mode 100644 index 00000000000..6fb49e6c13b --- /dev/null +++ b/compiler/testData/ir/irText/classes/innerClass.kt @@ -0,0 +1,5 @@ +class Outer { + open inner class TestInnerClass + + inner class DerivedInnerClass : TestInnerClass() +} diff --git a/compiler/testData/ir/irText/classes/innerClass.txt b/compiler/testData/ir/irText/classes/innerClass.txt new file mode 100644 index 00000000000..bdd255c6d40 --- /dev/null +++ b/compiler/testData/ir/irText/classes/innerClass.txt @@ -0,0 +1,17 @@ +FILE /innerClass.kt + CLASS CLASS Outer + CONSTRUCTOR public constructor Outer() + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any + INSTANCE_INITIALIZER_CALL classDescriptor=Outer + CLASS CLASS TestInnerClass + CONSTRUCTOR public constructor TestInnerClass() + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any + INSTANCE_INITIALIZER_CALL classDescriptor=TestInnerClass + CLASS CLASS DerivedInnerClass + CONSTRUCTOR public constructor DerivedInnerClass() + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL TestInnerClass + $this: THIS public final class Outer type=Outer + INSTANCE_INITIALIZER_CALL classDescriptor=DerivedInnerClass diff --git a/compiler/testData/ir/irText/classes/localClasses.txt b/compiler/testData/ir/irText/classes/localClasses.txt index f4c97f49653..8c366d3a938 100644 --- a/compiler/testData/ir/irText/classes/localClasses.txt +++ b/compiler/testData/ir/irText/classes/localClasses.txt @@ -4,6 +4,7 @@ FILE /localClasses.kt CLASS CLASS LocalClass CONSTRUCTOR public constructor LocalClass() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=LocalClass FUN public final fun foo(): kotlin.Unit BLOCK_BODY diff --git a/compiler/testData/ir/irText/classes/objectLiteralExpressions.txt b/compiler/testData/ir/irText/classes/objectLiteralExpressions.txt index dd8c3ba2274..059829aad73 100644 --- a/compiler/testData/ir/irText/classes/objectLiteralExpressions.txt +++ b/compiler/testData/ir/irText/classes/objectLiteralExpressions.txt @@ -7,6 +7,7 @@ FILE /objectLiteralExpressions.kt CLASS CLASS CONSTRUCTOR public constructor () BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor= CALL . type=test1. operator=OBJECT_LITERAL PROPERTY public val test2: IFoo @@ -15,6 +16,7 @@ FILE /objectLiteralExpressions.kt CLASS CLASS CONSTRUCTOR public constructor () BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor= FUN public open override /*1*/ fun foo(): kotlin.Unit BLOCK_BODY @@ -24,10 +26,12 @@ FILE /objectLiteralExpressions.kt CLASS CLASS Outer CONSTRUCTOR public constructor Outer() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=Outer CLASS CLASS Inner CONSTRUCTOR public constructor Inner() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=Inner FUN public final fun test3(): Outer.Inner BLOCK_BODY @@ -36,7 +40,7 @@ FILE /objectLiteralExpressions.kt CLASS CLASS CONSTRUCTOR public constructor () BLOCK_BODY - CALL . type=Outer.Inner operator=SUPER_CONSTRUCTOR_CALL + DELEGATING_CONSTRUCTOR_CALL Inner $this: THIS public final class Outer type=Outer INSTANCE_INITIALIZER_CALL classDescriptor= FUN public open override /*1*/ fun foo(): kotlin.Unit @@ -51,7 +55,7 @@ FILE /objectLiteralExpressions.kt CLASS CLASS CONSTRUCTOR public constructor () BLOCK_BODY - CALL . type=Outer.Inner operator=SUPER_CONSTRUCTOR_CALL + DELEGATING_CONSTRUCTOR_CALL Inner $this: $RECEIVER of: test4 type=Outer INSTANCE_INITIALIZER_CALL classDescriptor= FUN public open override /*1*/ fun foo(): kotlin.Unit diff --git a/compiler/testData/ir/irText/classes/objectWithInitializers.txt b/compiler/testData/ir/irText/classes/objectWithInitializers.txt index bb99bfe85ed..d6893f2964f 100644 --- a/compiler/testData/ir/irText/classes/objectWithInitializers.txt +++ b/compiler/testData/ir/irText/classes/objectWithInitializers.txt @@ -2,11 +2,12 @@ FILE /objectWithInitializers.kt CLASS CLASS Base CONSTRUCTOR public constructor Base() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=Base CLASS OBJECT Test CONSTRUCTOR private constructor Test() BLOCK_BODY - CALL . type=Base operator=SUPER_CONSTRUCTOR_CALL + DELEGATING_CONSTRUCTOR_CALL Base INSTANCE_INITIALIZER_CALL classDescriptor=Test PROPERTY public final val x: kotlin.Int = 1 EXPRESSION_BODY diff --git a/compiler/testData/ir/irText/classes/primaryConstructor.txt b/compiler/testData/ir/irText/classes/primaryConstructor.txt index 573dae23a5f..33b8b16042d 100644 --- a/compiler/testData/ir/irText/classes/primaryConstructor.txt +++ b/compiler/testData/ir/irText/classes/primaryConstructor.txt @@ -2,6 +2,7 @@ FILE /primaryConstructor.kt CLASS CLASS Test1 CONSTRUCTOR public constructor Test1(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.Int) BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any SET_BACKING_FIELD x type=kotlin.Unit operator=null GET_VAR x type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER SET_BACKING_FIELD y type=kotlin.Unit operator=null @@ -16,6 +17,7 @@ FILE /primaryConstructor.kt CLASS CLASS Test2 CONSTRUCTOR public constructor Test2(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.Int) BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any SET_BACKING_FIELD y type=kotlin.Unit operator=null GET_VAR y type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER INSTANCE_INITIALIZER_CALL classDescriptor=Test2 @@ -28,6 +30,7 @@ FILE /primaryConstructor.kt CLASS CLASS Test3 CONSTRUCTOR public constructor Test3(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.Int) BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any SET_BACKING_FIELD y type=kotlin.Unit operator=null GET_VAR y type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER INSTANCE_INITIALIZER_CALL classDescriptor=Test3 diff --git a/compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.txt b/compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.txt index a333b9b6e01..b06bdee5d87 100644 --- a/compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.txt +++ b/compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.txt @@ -2,21 +2,22 @@ FILE /primaryConstructorWithSuperConstructorCall.kt CLASS CLASS Base CONSTRUCTOR public constructor Base() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=Base CLASS CLASS TestImplicitPrimaryConstructor CONSTRUCTOR public constructor TestImplicitPrimaryConstructor() BLOCK_BODY - CALL . type=Base operator=SUPER_CONSTRUCTOR_CALL + DELEGATING_CONSTRUCTOR_CALL Base INSTANCE_INITIALIZER_CALL classDescriptor=TestImplicitPrimaryConstructor CLASS CLASS TestExplicitPrimaryConstructor CONSTRUCTOR public constructor TestExplicitPrimaryConstructor() BLOCK_BODY - CALL . type=Base operator=SUPER_CONSTRUCTOR_CALL + DELEGATING_CONSTRUCTOR_CALL Base INSTANCE_INITIALIZER_CALL classDescriptor=TestExplicitPrimaryConstructor CLASS CLASS TestWithDelegatingConstructor CONSTRUCTOR public constructor TestWithDelegatingConstructor(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.Int) BLOCK_BODY - CALL . type=Base operator=SUPER_CONSTRUCTOR_CALL + DELEGATING_CONSTRUCTOR_CALL Base SET_BACKING_FIELD x type=kotlin.Unit operator=null GET_VAR x type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER SET_BACKING_FIELD y type=kotlin.Unit operator=null diff --git a/compiler/testData/ir/irText/classes/qualifiedSuperCalls.txt b/compiler/testData/ir/irText/classes/qualifiedSuperCalls.txt index f6bf083a0bc..3c1e5a298a3 100644 --- a/compiler/testData/ir/irText/classes/qualifiedSuperCalls.txt +++ b/compiler/testData/ir/irText/classes/qualifiedSuperCalls.txt @@ -18,6 +18,7 @@ FILE /qualifiedSuperCalls.kt CLASS CLASS CBoth CONSTRUCTOR public constructor CBoth() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=CBoth FUN public open override /*2*/ fun foo(): kotlin.Unit BLOCK_BODY diff --git a/compiler/testData/ir/irText/classes/sealedClasses.txt b/compiler/testData/ir/irText/classes/sealedClasses.txt index 5733d80b40b..d5668a96f5f 100644 --- a/compiler/testData/ir/irText/classes/sealedClasses.txt +++ b/compiler/testData/ir/irText/classes/sealedClasses.txt @@ -2,11 +2,12 @@ FILE /sealedClasses.kt CLASS CLASS Expr CONSTRUCTOR private constructor Expr() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=Expr CLASS CLASS Const CONSTRUCTOR public constructor Const(/*0*/ number: kotlin.Double) BLOCK_BODY - CALL . type=Expr operator=SUPER_CONSTRUCTOR_CALL + DELEGATING_CONSTRUCTOR_CALL Expr SET_BACKING_FIELD number type=kotlin.Unit operator=null GET_VAR number type=kotlin.Double operator=INITIALIZE_PROPERTY_FROM_PARAMETER INSTANCE_INITIALIZER_CALL classDescriptor=Const @@ -16,7 +17,7 @@ FILE /sealedClasses.kt CLASS CLASS Sum CONSTRUCTOR public constructor Sum(/*0*/ e1: Expr, /*1*/ e2: Expr) BLOCK_BODY - CALL . type=Expr operator=SUPER_CONSTRUCTOR_CALL + DELEGATING_CONSTRUCTOR_CALL Expr SET_BACKING_FIELD e1 type=kotlin.Unit operator=null GET_VAR e1 type=Expr operator=INITIALIZE_PROPERTY_FROM_PARAMETER SET_BACKING_FIELD e2 type=kotlin.Unit operator=null @@ -31,5 +32,5 @@ FILE /sealedClasses.kt CLASS OBJECT NotANumber CONSTRUCTOR private constructor NotANumber() BLOCK_BODY - CALL . type=Expr operator=SUPER_CONSTRUCTOR_CALL + DELEGATING_CONSTRUCTOR_CALL Expr INSTANCE_INITIALIZER_CALL classDescriptor=NotANumber diff --git a/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.txt b/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.txt index 02bb8c20309..c85754859aa 100644 --- a/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.txt +++ b/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.txt @@ -2,6 +2,7 @@ FILE /secondaryConstructorWithInitializersFromClassBody.kt CLASS CLASS Base CONSTRUCTOR public constructor Base() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=Base CLASS CLASS TestProperty PROPERTY public final val x: kotlin.Int = 0 diff --git a/compiler/testData/ir/irText/classes/superCalls.txt b/compiler/testData/ir/irText/classes/superCalls.txt index 579ab830c9a..47a3a75b30c 100644 --- a/compiler/testData/ir/irText/classes/superCalls.txt +++ b/compiler/testData/ir/irText/classes/superCalls.txt @@ -2,6 +2,7 @@ FILE /superCalls.kt CLASS CLASS Base CONSTRUCTOR public constructor Base() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=Base FUN public open fun foo(): kotlin.Unit BLOCK_BODY @@ -11,7 +12,7 @@ FILE /superCalls.kt CLASS CLASS Derived CONSTRUCTOR public constructor Derived() BLOCK_BODY - CALL . type=Base operator=SUPER_CONSTRUCTOR_CALL + DELEGATING_CONSTRUCTOR_CALL Base INSTANCE_INITIALIZER_CALL classDescriptor=Derived FUN public open override /*1*/ fun foo(): kotlin.Unit BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/delegatedProperties.txt b/compiler/testData/ir/irText/declarations/delegatedProperties.txt index c9ce5687239..ea402a4efae 100644 --- a/compiler/testData/ir/irText/declarations/delegatedProperties.txt +++ b/compiler/testData/ir/irText/declarations/delegatedProperties.txt @@ -19,6 +19,7 @@ FILE /delegatedProperties.kt CLASS CLASS C CONSTRUCTOR public constructor C(/*0*/ map: kotlin.collections.MutableMap) BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any SET_BACKING_FIELD map type=kotlin.Unit operator=null GET_VAR map type=kotlin.collections.MutableMap operator=INITIALIZE_PROPERTY_FROM_PARAMETER INSTANCE_INITIALIZER_CALL classDescriptor=C diff --git a/compiler/testData/ir/irText/declarations/typeAlias.txt b/compiler/testData/ir/irText/declarations/typeAlias.txt index fd1156cc6da..cbedaf77dd6 100644 --- a/compiler/testData/ir/irText/declarations/typeAlias.txt +++ b/compiler/testData/ir/irText/declarations/typeAlias.txt @@ -6,5 +6,6 @@ FILE /typeAlias.kt CLASS CLASS C CONSTRUCTOR public constructor C() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=C TYPEALIAS TestNested type=kotlin.String diff --git a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.txt b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.txt index 3e090734a12..e9b8d019515 100644 --- a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.txt +++ b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.txt @@ -14,6 +14,7 @@ FILE /arrayAugmentedAssignment1.kt CLASS CLASS C CONSTRUCTOR public constructor C(/*0*/ x: kotlin.IntArray) BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any SET_BACKING_FIELD x type=kotlin.Unit operator=null GET_VAR x type=kotlin.IntArray operator=INITIALIZE_PROPERTY_FROM_PARAMETER INSTANCE_INITIALIZER_CALL classDescriptor=C diff --git a/compiler/testData/ir/irText/expressions/assignments.txt b/compiler/testData/ir/irText/expressions/assignments.txt index d5add9d3de2..6099b8f5194 100644 --- a/compiler/testData/ir/irText/expressions/assignments.txt +++ b/compiler/testData/ir/irText/expressions/assignments.txt @@ -2,6 +2,7 @@ FILE /assignments.kt CLASS CLASS Ref CONSTRUCTOR public constructor Ref(/*0*/ x: kotlin.Int) BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any SET_BACKING_FIELD x type=kotlin.Unit operator=null GET_VAR x type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER INSTANCE_INITIALIZER_CALL classDescriptor=Ref diff --git a/compiler/testData/ir/irText/expressions/augmentedAssignment2.txt b/compiler/testData/ir/irText/expressions/augmentedAssignment2.txt index 61af9081f89..9ab346c30e5 100644 --- a/compiler/testData/ir/irText/expressions/augmentedAssignment2.txt +++ b/compiler/testData/ir/irText/expressions/augmentedAssignment2.txt @@ -2,6 +2,7 @@ FILE /augmentedAssignment2.kt CLASS CLASS A CONSTRUCTOR public constructor A() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=A FUN public operator fun A.plusAssign(/*0*/ s: kotlin.String): kotlin.Unit BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/chainOfSafeCalls.txt b/compiler/testData/ir/irText/expressions/chainOfSafeCalls.txt index 79343972834..018a4f64a34 100644 --- a/compiler/testData/ir/irText/expressions/chainOfSafeCalls.txt +++ b/compiler/testData/ir/irText/expressions/chainOfSafeCalls.txt @@ -2,6 +2,7 @@ FILE /chainOfSafeCalls.kt CLASS CLASS C CONSTRUCTOR public constructor C() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=C FUN public final fun foo(): C BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.txt b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.txt index 17f02bc7735..b7c76accc83 100644 --- a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.txt +++ b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.txt @@ -2,10 +2,12 @@ FILE /forWithImplicitReceivers.kt CLASS OBJECT FiveTimes CONSTRUCTOR private constructor FiveTimes() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=FiveTimes CLASS CLASS IntCell CONSTRUCTOR public constructor IntCell(/*0*/ value: kotlin.Int) BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any SET_BACKING_FIELD value type=kotlin.Unit operator=null GET_VAR value type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER INSTANCE_INITIALIZER_CALL classDescriptor=IntCell diff --git a/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.txt b/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.txt index 238ee2ca4cc..34cef009b21 100644 --- a/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.txt +++ b/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.txt @@ -23,6 +23,7 @@ FILE /jvmStaticFieldReference.kt CLASS CLASS TestClass CONSTRUCTOR public constructor TestClass() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=TestClass PROPERTY public final val test: kotlin.Int EXPRESSION_BODY diff --git a/compiler/testData/ir/irText/expressions/reflectionLiterals.txt b/compiler/testData/ir/irText/expressions/reflectionLiterals.txt index 96712547df5..6ed1f97a8ce 100644 --- a/compiler/testData/ir/irText/expressions/reflectionLiterals.txt +++ b/compiler/testData/ir/irText/expressions/reflectionLiterals.txt @@ -2,6 +2,7 @@ FILE /reflectionLiterals.kt CLASS CLASS A CONSTRUCTOR public constructor A() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=A FUN public final fun foo(): kotlin.Unit BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.txt b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.txt index f7e0db28df1..78a937b7eba 100644 --- a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.txt +++ b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.txt @@ -2,6 +2,7 @@ FILE /safeCallWithIncrementDecrement.kt CLASS CLASS C CONSTRUCTOR public constructor C() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=C PROPERTY public var test.C?.p: kotlin.Int PROPERTY_GETTER public fun test.C?.(): kotlin.Int diff --git a/compiler/testData/ir/irText/expressions/safeCalls.txt b/compiler/testData/ir/irText/expressions/safeCalls.txt index 4ebf2509452..141ff55f2e1 100644 --- a/compiler/testData/ir/irText/expressions/safeCalls.txt +++ b/compiler/testData/ir/irText/expressions/safeCalls.txt @@ -2,6 +2,7 @@ FILE /safeCalls.kt CLASS CLASS Ref CONSTRUCTOR public constructor Ref(/*0*/ value: kotlin.Int) BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any SET_BACKING_FIELD value type=kotlin.Unit operator=null GET_VAR value type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER INSTANCE_INITIALIZER_CALL classDescriptor=Ref diff --git a/compiler/testData/ir/irText/expressions/values.txt b/compiler/testData/ir/irText/expressions/values.txt index 655fdbdcfb3..d494965b811 100644 --- a/compiler/testData/ir/irText/expressions/values.txt +++ b/compiler/testData/ir/irText/expressions/values.txt @@ -13,6 +13,7 @@ FILE /values.kt CLASS OBJECT A CONSTRUCTOR private constructor A() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=A PROPERTY public val a: kotlin.Int = 0 EXPRESSION_BODY @@ -20,10 +21,12 @@ FILE /values.kt CLASS CLASS Z CONSTRUCTOR public constructor Z() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=Z CLASS OBJECT Companion CONSTRUCTOR private constructor Companion() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=Companion FUN public fun test1(): Enum BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/when.txt b/compiler/testData/ir/irText/expressions/when.txt index b30e3e4d079..ccbdb8792fe 100644 --- a/compiler/testData/ir/irText/expressions/when.txt +++ b/compiler/testData/ir/irText/expressions/when.txt @@ -2,6 +2,7 @@ FILE /when.kt CLASS OBJECT A CONSTRUCTOR private constructor A() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=A FUN public fun testWithSubject(/*0*/ x: kotlin.Any?): kotlin.String BLOCK_BODY diff --git a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.txt b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.txt index ea91e24dcc9..75017a20f76 100644 --- a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.txt +++ b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.txt @@ -2,10 +2,12 @@ FILE /multipleImplicitReceivers.kt CLASS OBJECT A CONSTRUCTOR private constructor A() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=A CLASS OBJECT B CONSTRUCTOR private constructor B() BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL Any INSTANCE_INITIALIZER_CALL classDescriptor=B CLASS INTERFACE IFoo PROPERTY public open val A.foo: B diff --git a/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java b/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java index 60ae0e75b1e..573c0cbde57 100644 --- a/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java @@ -115,6 +115,12 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase { doTest(fileName); } + @TestMetadata("innerClass.kt") + public void testInnerClass() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/classes/innerClass.kt"); + doTest(fileName); + } + @TestMetadata("localClasses.kt") public void testLocalClasses() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/classes/localClasses.kt");