diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt index f6ecd616bbd..2d4f06f2029 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt @@ -829,7 +829,8 @@ class Fir2IrVisitor( endOffset, anonymousClassType, anonymousClass.constructors.first().symbol, - anonymousClass.typeParameters.size + anonymousClass.typeParameters.size, + origin = IrStatementOrigin.OBJECT_LITERAL ) ) ) diff --git a/compiler/testData/ir/irText/classes/delegatedImplementation.fir.txt b/compiler/testData/ir/irText/classes/delegatedImplementation.fir.txt index 22b4e1710f1..49ee6633071 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementation.fir.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementation.fir.txt @@ -162,7 +162,7 @@ FILE fqName: fileName:/delegatedImplementation.kt $receiver: VALUE_PARAMETER name: type:kotlin.Byte VALUE_PARAMETER name:value index:0 type:kotlin.Int BLOCK_BODY - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .otherImpl.' type=.otherImpl. origin=null + CONSTRUCTOR_CALL 'private constructor () [primary] declared in .otherImpl.' type=.otherImpl. origin=OBJECT_LITERAL CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.IBase] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 CONSTRUCTOR visibility:public <> () returnType:.Test1 [primary] diff --git a/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.fir.txt b/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.fir.txt index 102ca6d605d..9e143927c1f 100644 --- a/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.fir.txt +++ b/compiler/testData/ir/irText/classes/lambdaInDataClassDefaultParameter.fir.txt @@ -62,7 +62,7 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.Any]' - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .B..' type=.B.. origin=null + CONSTRUCTOR_CALL 'private constructor () [primary] declared in .B..' type=.B.. origin=OBJECT_LITERAL BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' diff --git a/compiler/testData/ir/irText/classes/objectLiteralExpressions.fir.txt b/compiler/testData/ir/irText/classes/objectLiteralExpressions.fir.txt index b5c17b04b0f..ef6001a2c52 100644 --- a/compiler/testData/ir/irText/classes/objectLiteralExpressions.fir.txt +++ b/compiler/testData/ir/irText/classes/objectLiteralExpressions.fir.txt @@ -26,7 +26,7 @@ FILE fqName: fileName:/objectLiteralExpressions.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.Any]' - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .test1.' type=.test1. origin=null + CONSTRUCTOR_CALL 'private constructor () [primary] declared in .test1.' type=.test1. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.test1. correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] BLOCK_BODY @@ -47,7 +47,7 @@ FILE fqName: fileName:/objectLiteralExpressions.kt BLOCK_BODY CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null message: CONST String type=kotlin.String value="foo" - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .test2.' type=.test2. origin=null + CONSTRUCTOR_CALL 'private constructor () [primary] declared in .test2.' type=.test2. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.test2. correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] BLOCK_BODY @@ -98,7 +98,7 @@ FILE fqName: fileName:/objectLiteralExpressions.kt BLOCK_BODY CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null message: CONST String type=kotlin.String value="foo" - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .Outer.test3.' type=.Outer.test3. origin=null + CONSTRUCTOR_CALL 'private constructor () [primary] declared in .Outer.test3.' type=.Outer.test3. origin=OBJECT_LITERAL FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any @@ -128,4 +128,4 @@ FILE fqName: fileName:/objectLiteralExpressions.kt BLOCK_BODY CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null message: CONST String type=kotlin.String value="foo" - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .test4.' type=.test4. origin=null + CONSTRUCTOR_CALL 'private constructor () [primary] declared in .test4.' type=.test4. origin=OBJECT_LITERAL diff --git a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt index c4ddb6ca0c4..fbcfa46ee98 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt +++ b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt @@ -88,7 +88,7 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt value: CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=null $this: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z' type=.MyEnum.Z origin=null - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .MyEnum.Z.anObject.' type=.MyEnum.Z.anObject. origin=null + CONSTRUCTOR_CALL 'private constructor () [primary] declared in .MyEnum.Z.anObject.' type=.MyEnum.Z.anObject. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.MyEnum.Z) returnType:.MyEnum.Z.anObject. correspondingProperty: PROPERTY name:anObject visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.MyEnum.Z diff --git a/compiler/testData/ir/irText/expressions/funInterface/partialSam.fir.txt b/compiler/testData/ir/irText/expressions/funInterface/partialSam.fir.txt index 18246486e77..b1023a2c0d6 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/partialSam.fir.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/partialSam.fir.txt @@ -73,7 +73,7 @@ FILE fqName: fileName:/partialSam.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun run (s: kotlin.String, i: kotlin.Int, t: kotlin.String): kotlin.Int declared in .fsi.' CONST Int type=kotlin.Int value=1 - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .fsi.' type=.fsi. origin=null + CONSTRUCTOR_CALL 'private constructor () [primary] declared in .fsi.' type=.fsi. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.fsi. correspondingProperty: PROPERTY name:fsi visibility:public modality:FINAL [val] BLOCK_BODY @@ -97,7 +97,7 @@ FILE fqName: fileName:/partialSam.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun run (s: kotlin.String, i: kotlin.Int, t: kotlin.Int): kotlin.String declared in .fis.' CONST String type=kotlin.String value="" - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .fis.' type=.fis. origin=null + CONSTRUCTOR_CALL 'private constructor () [primary] declared in .fis.' type=.fis. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.fis. correspondingProperty: PROPERTY name:fis visibility:public modality:FINAL [val] BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/multipleThisReferences.fir.txt b/compiler/testData/ir/irText/expressions/multipleThisReferences.fir.txt index ae99a186c41..e02aa2810cf 100644 --- a/compiler/testData/ir/irText/expressions/multipleThisReferences.fir.txt +++ b/compiler/testData/ir/irText/expressions/multipleThisReferences.fir.txt @@ -94,7 +94,7 @@ FILE fqName: fileName:/multipleThisReferences.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Host.test.' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xx type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Host.test. declared in .Host.test..' type=.Host.test. origin=null - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .Host.test.' type=.Host.test. origin=null + CONSTRUCTOR_CALL 'private constructor () [primary] declared in .Host.test.' type=.Host.test. origin=OBJECT_LITERAL FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/objectReference.fir.txt b/compiler/testData/ir/irText/expressions/objectReference.fir.txt index df1384b6caf..c7ed289c97d 100644 --- a/compiler/testData/ir/irText/expressions/objectReference.fir.txt +++ b/compiler/testData/ir/irText/expressions/objectReference.fir.txt @@ -142,7 +142,7 @@ FILE fqName: fileName:/objectReference.kt value: CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null $this: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .Z.anObject.' type=.Z.anObject. origin=null + CONSTRUCTOR_CALL 'private constructor () [primary] declared in .Z.anObject.' type=.Z.anObject. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Z) returnType:.Z.anObject. correspondingProperty: PROPERTY name:anObject visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.Z diff --git a/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.fir.txt b/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.fir.txt index 8b432718c63..e854f9125a9 100644 --- a/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.fir.txt +++ b/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.fir.txt @@ -89,4 +89,4 @@ FILE fqName: fileName:/thisOfGenericOuterClass.kt RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .test.' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:xx type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .test. declared in .test..' type=.test. origin=null - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .test.' type=.test. origin=null + CONSTRUCTOR_CALL 'private constructor () [primary] declared in .test.' type=.test. origin=OBJECT_LITERAL diff --git a/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.fir.txt b/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.fir.txt index 3788e3c80d0..7b2f99fa530 100644 --- a/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.fir.txt +++ b/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.fir.txt @@ -10,7 +10,7 @@ FILE fqName: fileName:/thisReferenceBeforeClassDeclared.kt BLOCK_BODY ERROR_CALL 'Cannot find delegated constructor call' type=.test. INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.WithCompanion]' - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .test.' type=.test. origin=null + CONSTRUCTOR_CALL 'private constructor () [primary] declared in .test.' type=.test. origin=OBJECT_LITERAL VAR name:test2 type:.test. [val] BLOCK type=.test. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.WithCompanion] @@ -20,7 +20,7 @@ FILE fqName: fileName:/thisReferenceBeforeClassDeclared.kt DELEGATING_CONSTRUCTOR_CALL 'public constructor (a: .WithCompanion.Companion) [primary] declared in .WithCompanion' a: ERROR_CALL 'Unresolved reference: #' type=IrErrorType INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.WithCompanion]' - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .test.' type=.test. origin=null + CONSTRUCTOR_CALL 'private constructor () [primary] declared in .test.' type=.test. origin=OBJECT_LITERAL CLASS CLASS name:WithCompanion modality:OPEN visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.WithCompanion CONSTRUCTOR visibility:public <> (a:.WithCompanion.Companion) returnType:.WithCompanion [primary]