From cdf5a2a5a1f225b1e9819cee1996525a25154576 Mon Sep 17 00:00:00 2001 From: Jinseong Jeon Date: Wed, 25 Mar 2020 00:05:06 -0700 Subject: [PATCH] FIR: set dispatch receiver parameter for inner class's constructor. --- .../fir/backend/Fir2IrDeclarationStorage.kt | 17 +++++++++++++---- .../function/innerConstructorFromClass.kt | 1 - .../function/innerConstructorFromExtension.kt | 1 - .../innerConstructorFromTopLevelNoArgs.kt | 1 - .../innerConstructorFromTopLevelOneStringArg.kt | 1 - .../ir/irText/classes/initBlock.fir.txt | 3 ++- .../ir/irText/classes/innerClass.fir.txt | 6 ++++-- .../innerClassWithDelegatingConstructor.fir.txt | 6 ++++-- .../classes/objectLiteralExpressions.fir.txt | 3 ++- .../ir/irText/classes/outerClassAccess.fir.txt | 6 ++++-- .../declarations/parameters/class.fir.txt | 3 ++- .../declarations/parameters/constructor.fir.txt | 6 ++++-- .../parameters/genericInnerClass.fir.txt | 3 ++- .../boundInnerGenericConstructor.fir.txt | 3 ++- .../constructorWithAdaptedArguments.fir.txt | 3 ++- ...constructorWithOwnTypeParametersCall.fir.txt | 3 ++- .../ir/irText/expressions/kt16905.fir.txt | 9 ++++++--- .../ir/irText/expressions/kt30020.fir.txt | 3 ++- .../expressions/multipleThisReferences.fir.txt | 3 ++- .../outerClassInstanceReference.fir.txt | 3 ++- ...onversionInGenericConstructorCall_NI.fir.txt | 3 ++- .../expressions/thisOfGenericOuterClass.fir.txt | 3 ++- .../ir/irText/singletons/enumEntry.fir.txt | 3 ++- .../smartCastOnReceiverOfGenericType.fir.txt | 3 ++- 24 files changed, 63 insertions(+), 33 deletions(-) diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt index 30ccd221e15..daa7531b4a4 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt @@ -331,10 +331,10 @@ class Fir2IrDeclarationStorage( } } } - if (function !is FirConstructor) { + with(classifierStorage) { val thisOrigin = IrDeclarationOrigin.DEFINED - val receiverTypeRef = if (function !is FirPropertyAccessor) function?.receiverTypeRef else parentPropertyReceiverType - with(classifierStorage) { + if (function !is FirConstructor) { + val receiverTypeRef = if (function !is FirPropertyAccessor) function?.receiverTypeRef else parentPropertyReceiverType if (receiverTypeRef != null) { extensionReceiverParameter = receiverTypeRef.convertWithOffsets { startOffset, endOffset -> declareThisReceiverParameter( @@ -353,6 +353,15 @@ class Fir2IrDeclarationStorage( thisOrigin = thisOrigin ) } + } else { + // Set dispatch receiver parameter for inner class's constructor. + if (containingClass?.isInner == true) { + dispatchReceiverParameter = declareThisReceiverParameter( + parent, + thisType = containingClass.thisReceiver!!.type, + thisOrigin = thisOrigin + ) + } } } } @@ -478,7 +487,7 @@ class Fir2IrDeclarationStorage( isInline = false, isExternal = false, isPrimary = isPrimary, isExpect = false ).apply { enterScope(descriptor) - }.bindAndDeclareParameters(constructor, descriptor, irParent, isStatic = true).apply { + }.bindAndDeclareParameters(constructor, descriptor, irParent, isStatic = false).apply { leaveScope(descriptor) } } diff --git a/compiler/testData/codegen/box/callableReference/function/innerConstructorFromClass.kt b/compiler/testData/codegen/box/callableReference/function/innerConstructorFromClass.kt index b9b9be01e39..31bb102ee62 100644 --- a/compiler/testData/codegen/box/callableReference/function/innerConstructorFromClass.kt +++ b/compiler/testData/codegen/box/callableReference/function/innerConstructorFromClass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class A { inner class Inner { val o = 111 diff --git a/compiler/testData/codegen/box/callableReference/function/innerConstructorFromExtension.kt b/compiler/testData/codegen/box/callableReference/function/innerConstructorFromExtension.kt index aaeccc95f2d..bcde4b24cae 100644 --- a/compiler/testData/codegen/box/callableReference/function/innerConstructorFromExtension.kt +++ b/compiler/testData/codegen/box/callableReference/function/innerConstructorFromExtension.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class A { inner class Inner { val o = 111 diff --git a/compiler/testData/codegen/box/callableReference/function/innerConstructorFromTopLevelNoArgs.kt b/compiler/testData/codegen/box/callableReference/function/innerConstructorFromTopLevelNoArgs.kt index 57ab5ad4db5..577eb19e7af 100644 --- a/compiler/testData/codegen/box/callableReference/function/innerConstructorFromTopLevelNoArgs.kt +++ b/compiler/testData/codegen/box/callableReference/function/innerConstructorFromTopLevelNoArgs.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class A { inner class Inner { val o = 111 diff --git a/compiler/testData/codegen/box/callableReference/function/innerConstructorFromTopLevelOneStringArg.kt b/compiler/testData/codegen/box/callableReference/function/innerConstructorFromTopLevelOneStringArg.kt index 24f6a7c67b1..0eb2b831a2b 100644 --- a/compiler/testData/codegen/box/callableReference/function/innerConstructorFromTopLevelOneStringArg.kt +++ b/compiler/testData/codegen/box/callableReference/function/innerConstructorFromTopLevelOneStringArg.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class A { inner class Inner(val result: Int) } diff --git a/compiler/testData/ir/irText/classes/initBlock.fir.txt b/compiler/testData/ir/irText/classes/initBlock.fir.txt index 2aa36cf2f1f..4de6914be1b 100644 --- a/compiler/testData/ir/irText/classes/initBlock.fir.txt +++ b/compiler/testData/ir/irText/classes/initBlock.fir.txt @@ -116,7 +116,8 @@ FILE fqName: fileName:/initBlock.kt message: CONST String type=kotlin.String value="1" CLASS CLASS name:TestInner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test5.TestInner - CONSTRUCTOR visibility:public <> () returnType:.Test5.TestInner [primary] + CONSTRUCTOR visibility:public <> ($this:.Test5.TestInner) returnType:.Test5.TestInner [primary] + $outer: VALUE_PARAMETER name: type:.Test5.TestInner BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' diff --git a/compiler/testData/ir/irText/classes/innerClass.fir.txt b/compiler/testData/ir/irText/classes/innerClass.fir.txt index 8f0990e88f0..107a1840596 100644 --- a/compiler/testData/ir/irText/classes/innerClass.fir.txt +++ b/compiler/testData/ir/irText/classes/innerClass.fir.txt @@ -7,7 +7,8 @@ FILE fqName: fileName:/innerClass.kt INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' CLASS CLASS name:TestInnerClass modality:OPEN visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.TestInnerClass - CONSTRUCTOR visibility:public <> () returnType:.Outer.TestInnerClass [primary] + CONSTRUCTOR visibility:public <> ($this:.Outer.TestInnerClass) returnType:.Outer.TestInnerClass [primary] + $outer: VALUE_PARAMETER name: type:.Outer.TestInnerClass BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInnerClass modality:OPEN visibility:public [inner] superTypes:[kotlin.Any]' @@ -26,7 +27,8 @@ FILE fqName: fileName:/innerClass.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:DerivedInnerClass modality:FINAL visibility:public [inner] superTypes:[.Outer.TestInnerClass] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.DerivedInnerClass - CONSTRUCTOR visibility:public <> () returnType:.Outer.DerivedInnerClass [primary] + CONSTRUCTOR visibility:public <> ($this:.Outer.DerivedInnerClass) returnType:.Outer.DerivedInnerClass [primary] + $outer: VALUE_PARAMETER name: type:.Outer.DerivedInnerClass BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Outer.TestInnerClass' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DerivedInnerClass modality:FINAL visibility:public [inner] superTypes:[.Outer.TestInnerClass]' diff --git a/compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.fir.txt b/compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.fir.txt index 916720e6b3c..5507ea56d69 100644 --- a/compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.fir.txt +++ b/compiler/testData/ir/irText/classes/innerClassWithDelegatingConstructor.fir.txt @@ -7,7 +7,8 @@ FILE fqName: fileName:/innerClassWithDelegatingConstructor.kt INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Outer.Inner [primary] + CONSTRUCTOR visibility:public <> ($this:.Outer.Inner, x:kotlin.Int) returnType:.Outer.Inner [primary] + $outer: VALUE_PARAMETER name: type:.Outer.Inner VALUE_PARAMETER name:x index:0 type:kotlin.Int BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' @@ -23,7 +24,8 @@ FILE fqName: fileName:/innerClassWithDelegatingConstructor.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Outer.Inner' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Outer.Inner declared in .Outer.Inner.' type=.Outer.Inner origin=null - CONSTRUCTOR visibility:public <> () returnType:.Outer.Inner + CONSTRUCTOR visibility:public <> ($this:.Outer.Inner) returnType:.Outer.Inner + $outer: VALUE_PARAMETER name: type:.Outer.Inner BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int) [primary] declared in .Outer.Inner' x: CONST Int type=kotlin.Int value=0 diff --git a/compiler/testData/ir/irText/classes/objectLiteralExpressions.fir.txt b/compiler/testData/ir/irText/classes/objectLiteralExpressions.fir.txt index ef6001a2c52..2d886ba32e5 100644 --- a/compiler/testData/ir/irText/classes/objectLiteralExpressions.fir.txt +++ b/compiler/testData/ir/irText/classes/objectLiteralExpressions.fir.txt @@ -61,7 +61,8 @@ FILE fqName: fileName:/objectLiteralExpressions.kt INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' CLASS CLASS name:Inner modality:ABSTRACT visibility:public [inner] superTypes:[.IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner - CONSTRUCTOR visibility:public <> () returnType:.Outer.Inner [primary] + CONSTRUCTOR visibility:public <> ($this:.Outer.Inner) returnType:.Outer.Inner [primary] + $outer: VALUE_PARAMETER name: type:.Outer.Inner BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:ABSTRACT visibility:public [inner] superTypes:[.IFoo]' diff --git a/compiler/testData/ir/irText/classes/outerClassAccess.fir.txt b/compiler/testData/ir/irText/classes/outerClassAccess.fir.txt index 28af2324acd..95faa8a6a06 100644 --- a/compiler/testData/ir/irText/classes/outerClassAccess.fir.txt +++ b/compiler/testData/ir/irText/classes/outerClassAccess.fir.txt @@ -10,7 +10,8 @@ FILE fqName: fileName:/outerClassAccess.kt BLOCK_BODY CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner - CONSTRUCTOR visibility:public <> () returnType:.Outer.Inner [primary] + CONSTRUCTOR visibility:public <> ($this:.Outer.Inner) returnType:.Outer.Inner [primary] + $outer: VALUE_PARAMETER name: type:.Outer.Inner BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' @@ -21,7 +22,8 @@ FILE fqName: fileName:/outerClassAccess.kt $this: GET_VAR ': .Outer.Inner declared in .Outer.Inner.test' type=.Outer.Inner origin=null CLASS CLASS name:Inner2 modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner.Inner2 - CONSTRUCTOR visibility:public <> () returnType:.Outer.Inner.Inner2 [primary] + CONSTRUCTOR visibility:public <> ($this:.Outer.Inner.Inner2) returnType:.Outer.Inner.Inner2 [primary] + $outer: VALUE_PARAMETER name: type:.Outer.Inner.Inner2 BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner2 modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' diff --git a/compiler/testData/ir/irText/declarations/parameters/class.fir.txt b/compiler/testData/ir/irText/declarations/parameters/class.fir.txt index 5c18c7f4a14..caea0239a54 100644 --- a/compiler/testData/ir/irText/declarations/parameters/class.fir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/class.fir.txt @@ -61,7 +61,8 @@ FILE fqName: fileName:/class.kt CLASS CLASS name:TestInner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test.TestInner.Test.TestInner> TYPE_PARAMETER name:T2 index:0 variance: superTypes:[kotlin.Any?] - CONSTRUCTOR visibility:public <> () returnType:.Test.TestInner.Test.TestInner> [primary] + CONSTRUCTOR visibility:public <> ($this:.Test.TestInner.Test.TestInner>) returnType:.Test.TestInner.Test.TestInner> [primary] + $outer: VALUE_PARAMETER name: type:.Test.TestInner.Test.TestInner> BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' diff --git a/compiler/testData/ir/irText/declarations/parameters/constructor.fir.txt b/compiler/testData/ir/irText/declarations/parameters/constructor.fir.txt index ce2ad56a37e..f038d1025dc 100644 --- a/compiler/testData/ir/irText/declarations/parameters/constructor.fir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/constructor.fir.txt @@ -66,7 +66,8 @@ FILE fqName: fileName:/constructor.kt CLASS CLASS name:TestInner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2.TestInner.Test2.TestInner> TYPE_PARAMETER name:Z index:0 variance: superTypes:[kotlin.Any?] - CONSTRUCTOR visibility:public <> (z:Z of .Test2.TestInner) returnType:.Test2.TestInner.Test2.TestInner> [primary] + CONSTRUCTOR visibility:public <> ($this:.Test2.TestInner.Test2.TestInner>, z:Z of .Test2.TestInner) returnType:.Test2.TestInner.Test2.TestInner> [primary] + $outer: VALUE_PARAMETER name: type:.Test2.TestInner.Test2.TestInner> VALUE_PARAMETER name:z index:0 type:Z of .Test2.TestInner BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' @@ -82,7 +83,8 @@ FILE fqName: fileName:/constructor.kt RETURN type=kotlin.Nothing from='public final fun (): Z of .Test2.TestInner declared in .Test2.TestInner' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:Z of .Test2.TestInner visibility:private [final]' type=Z of .Test2.TestInner origin=null receiver: GET_VAR ': .Test2.TestInner.Test2.TestInner> declared in .Test2.TestInner.' type=.Test2.TestInner.Test2.TestInner> origin=null - CONSTRUCTOR visibility:public <> (z:Z of .Test2.TestInner, i:kotlin.Int) returnType:.Test2.TestInner.Test2.TestInner> + CONSTRUCTOR visibility:public <> ($this:.Test2.TestInner.Test2.TestInner>, z:Z of .Test2.TestInner, i:kotlin.Int) returnType:.Test2.TestInner.Test2.TestInner> + $outer: VALUE_PARAMETER name: type:.Test2.TestInner.Test2.TestInner> VALUE_PARAMETER name:z index:0 type:Z of .Test2.TestInner VALUE_PARAMETER name:i index:1 type:kotlin.Int BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/parameters/genericInnerClass.fir.txt b/compiler/testData/ir/irText/declarations/parameters/genericInnerClass.fir.txt index 4c78bfca335..dececb29b4f 100644 --- a/compiler/testData/ir/irText/declarations/parameters/genericInnerClass.fir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/genericInnerClass.fir.txt @@ -9,7 +9,8 @@ FILE fqName: fileName:/genericInnerClass.kt CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner.Outer.Inner> TYPE_PARAMETER name:T2 index:0 variance: superTypes:[kotlin.Any?] - CONSTRUCTOR visibility:public <> () returnType:.Outer.Inner.Outer.Inner> [primary] + CONSTRUCTOR visibility:public <> ($this:.Outer.Inner.Outer.Inner>) returnType:.Outer.Inner.Outer.Inner> [primary] + $outer: VALUE_PARAMETER name: type:.Outer.Inner.Outer.Inner> BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' diff --git a/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.fir.txt index e4cb6c9b60d..a5980093be3 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.fir.txt @@ -9,7 +9,8 @@ FILE fqName:test fileName:/boundInnerGenericConstructor.kt CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:test.Foo.Inner

TYPE_PARAMETER name:P index:0 variance: superTypes:[kotlin.Any?] - CONSTRUCTOR visibility:public <> (a:T of test.Foo, b:P of test.Foo.Inner) returnType:test.Foo.Inner

[primary] + CONSTRUCTOR visibility:public <> ($this:test.Foo.Inner

, a:T of test.Foo, b:P of test.Foo.Inner) returnType:test.Foo.Inner

[primary] + $outer: VALUE_PARAMETER name: type:test.Foo.Inner

VALUE_PARAMETER name:a index:0 type:T of test.Foo VALUE_PARAMETER name:b index:1 type:P of test.Foo.Inner BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.fir.txt index d314a5c5a1d..c7541ccd5b5 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.fir.txt @@ -34,7 +34,8 @@ FILE fqName: fileName:/constructorWithAdaptedArguments.kt INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner - CONSTRUCTOR visibility:public <> (xs:kotlin.IntArray) returnType:.Outer.Inner [primary] + CONSTRUCTOR visibility:public <> ($this:.Outer.Inner, xs:kotlin.IntArray) returnType:.Outer.Inner [primary] + $outer: VALUE_PARAMETER name: type:.Outer.Inner VALUE_PARAMETER name:xs index:0 type:kotlin.IntArray varargElementType:kotlin.Int [vararg] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' diff --git a/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.fir.txt b/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.fir.txt index ea8c2b06450..51c34d6845c 100644 --- a/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.fir.txt +++ b/compiler/testData/ir/irText/expressions/constructorWithOwnTypeParametersCall.fir.txt @@ -18,7 +18,8 @@ FILE fqName: fileName:/constructorWithOwnTypeParametersCall.kt CLASS CLASS name:K2 modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.K1.K2.K1.K2> TYPE_PARAMETER name:T2 index:0 variance: superTypes:[kotlin.CharSequence] - CONSTRUCTOR visibility:public <> () returnType:.K1.K2.K1.K2> [primary] + CONSTRUCTOR visibility:public <> ($this:.K1.K2.K1.K2>) returnType:.K1.K2.K1.K2> [primary] + $outer: VALUE_PARAMETER name: type:.K1.K2.K1.K2> 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]' diff --git a/compiler/testData/ir/irText/expressions/kt16905.fir.txt b/compiler/testData/ir/irText/expressions/kt16905.fir.txt index b4f7759c206..c1a9291d413 100644 --- a/compiler/testData/ir/irText/expressions/kt16905.fir.txt +++ b/compiler/testData/ir/irText/expressions/kt16905.fir.txt @@ -7,7 +7,8 @@ FILE fqName: fileName:/kt16905.kt INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' CLASS CLASS name:Inner modality:OPEN visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner - CONSTRUCTOR visibility:public <> () returnType:.Outer.Inner [primary] + CONSTRUCTOR visibility:public <> ($this:.Outer.Inner) returnType:.Outer.Inner [primary] + $outer: VALUE_PARAMETER name: type:.Outer.Inner BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:OPEN visibility:public [inner] superTypes:[kotlin.Any]' @@ -26,7 +27,8 @@ FILE fqName: fileName:/kt16905.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:InnerDerived0 modality:FINAL visibility:public [inner] superTypes:[.Outer.Inner] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.InnerDerived0 - CONSTRUCTOR visibility:public <> () returnType:.Outer.InnerDerived0 [primary] + CONSTRUCTOR visibility:public <> ($this:.Outer.InnerDerived0) returnType:.Outer.InnerDerived0 [primary] + $outer: VALUE_PARAMETER name: type:.Outer.InnerDerived0 BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Outer.Inner' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:InnerDerived0 modality:FINAL visibility:public [inner] superTypes:[.Outer.Inner]' @@ -45,7 +47,8 @@ FILE fqName: fileName:/kt16905.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:InnerDerived1 modality:FINAL visibility:public [inner] superTypes:[.Outer.Inner] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.InnerDerived1 - CONSTRUCTOR visibility:public <> () returnType:.Outer.InnerDerived1 [primary] + CONSTRUCTOR visibility:public <> ($this:.Outer.InnerDerived1) returnType:.Outer.InnerDerived1 [primary] + $outer: VALUE_PARAMETER name: type:.Outer.InnerDerived1 BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Outer.Inner' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:InnerDerived1 modality:FINAL visibility:public [inner] superTypes:[.Outer.Inner]' diff --git a/compiler/testData/ir/irText/expressions/kt30020.fir.txt b/compiler/testData/ir/irText/expressions/kt30020.fir.txt index d610248a406..e75a5dceafe 100644 --- a/compiler/testData/ir/irText/expressions/kt30020.fir.txt +++ b/compiler/testData/ir/irText/expressions/kt30020.fir.txt @@ -104,7 +104,8 @@ FILE fqName: fileName:/kt30020.kt element: CONST Int type=kotlin.Int value=200 CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AML.Inner - CONSTRUCTOR visibility:public <> () returnType:.AML.Inner [primary] + CONSTRUCTOR visibility:public <> ($this:.AML.Inner) returnType:.AML.Inner [primary] + $outer: VALUE_PARAMETER name: type:.AML.Inner BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' diff --git a/compiler/testData/ir/irText/expressions/multipleThisReferences.fir.txt b/compiler/testData/ir/irText/expressions/multipleThisReferences.fir.txt index e02aa2810cf..d9ee6b7df31 100644 --- a/compiler/testData/ir/irText/expressions/multipleThisReferences.fir.txt +++ b/compiler/testData/ir/irText/expressions/multipleThisReferences.fir.txt @@ -7,7 +7,8 @@ FILE fqName: fileName:/multipleThisReferences.kt INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any]' CLASS CLASS name:Inner modality:OPEN visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Outer.Inner [primary] + CONSTRUCTOR visibility:public <> ($this:.Outer.Inner, x:kotlin.Int) returnType:.Outer.Inner [primary] + $outer: VALUE_PARAMETER name: type:.Outer.Inner VALUE_PARAMETER name:x index:0 type:kotlin.Int BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' diff --git a/compiler/testData/ir/irText/expressions/outerClassInstanceReference.fir.txt b/compiler/testData/ir/irText/expressions/outerClassInstanceReference.fir.txt index da11a5bbaff..dd6f338c720 100644 --- a/compiler/testData/ir/irText/expressions/outerClassInstanceReference.fir.txt +++ b/compiler/testData/ir/irText/expressions/outerClassInstanceReference.fir.txt @@ -10,7 +10,8 @@ FILE fqName: fileName:/outerClassInstanceReference.kt BLOCK_BODY CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner - CONSTRUCTOR visibility:public <> () returnType:.Outer.Inner [primary] + CONSTRUCTOR visibility:public <> ($this:.Outer.Inner) returnType:.Outer.Inner [primary] + $outer: VALUE_PARAMETER name: type:.Outer.Inner BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.fir.txt index 1b89ad1f9e9..56374da4364 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall_NI.fir.txt @@ -28,7 +28,8 @@ FILE fqName: fileName:/samConversionInGenericConstructorCall_NI.kt CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner.Outer.Inner> TYPE_PARAMETER name:T2 index:0 variance: superTypes:[kotlin.Any?] - CONSTRUCTOR visibility:public <> (j12:.J.Outer, T2 of .Outer.Inner>) returnType:.Outer.Inner.Outer.Inner> [primary] + CONSTRUCTOR visibility:public <> ($this:.Outer.Inner.Outer.Inner>, j12:.J.Outer, T2 of .Outer.Inner>) returnType:.Outer.Inner.Outer.Inner> [primary] + $outer: VALUE_PARAMETER name: type:.Outer.Inner.Outer.Inner> VALUE_PARAMETER name:j12 index:0 type:.J.Outer, T2 of .Outer.Inner> BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' diff --git a/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.fir.txt b/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.fir.txt index e854f9125a9..28779df043b 100644 --- a/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.fir.txt +++ b/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.fir.txt @@ -20,7 +20,8 @@ FILE fqName: fileName:/thisOfGenericOuterClass.kt receiver: GET_VAR ': .Outer.Outer> declared in .Outer.' type=.Outer.Outer> origin=null CLASS CLASS name:Inner modality:OPEN visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner - CONSTRUCTOR visibility:public <> (y:kotlin.Int) returnType:.Outer.Inner [primary] + CONSTRUCTOR visibility:public <> ($this:.Outer.Inner, y:kotlin.Int) returnType:.Outer.Inner [primary] + $outer: VALUE_PARAMETER name: type:.Outer.Inner VALUE_PARAMETER name:y index:0 type:kotlin.Int BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' diff --git a/compiler/testData/ir/irText/singletons/enumEntry.fir.txt b/compiler/testData/ir/irText/singletons/enumEntry.fir.txt index c8fee6e91ac..47f23272148 100644 --- a/compiler/testData/ir/irText/singletons/enumEntry.fir.txt +++ b/compiler/testData/ir/irText/singletons/enumEntry.fir.txt @@ -20,7 +20,8 @@ FILE fqName: fileName:/enumEntry.kt BLOCK_BODY CLASS CLASS name:A modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z.ENTRY.A - CONSTRUCTOR visibility:public <> () returnType:IrErrorType [primary] + CONSTRUCTOR visibility:public <> ($this:.Z.ENTRY.A) returnType:IrErrorType [primary] + $outer: VALUE_PARAMETER name: type:.Z.ENTRY.A BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' diff --git a/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.fir.txt b/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.fir.txt index ea74d6381f0..19783e737d2 100644 --- a/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.fir.txt +++ b/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.fir.txt @@ -105,7 +105,8 @@ FILE fqName: fileName:/smartCastOnReceiverOfGenericType.kt CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner.Outer.Inner> TYPE_PARAMETER name:T2 index:0 variance: superTypes:[kotlin.Any?] - CONSTRUCTOR visibility:public <> () returnType:.Outer.Inner.Outer.Inner> [primary] + CONSTRUCTOR visibility:public <> ($this:.Outer.Inner.Outer.Inner>) returnType:.Outer.Inner.Outer.Inner> [primary] + $outer: VALUE_PARAMETER name: type:.Outer.Inner.Outer.Inner> BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]'