From 0ecfcf43808b503e3325d34196a589a199e40c8c Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Wed, 15 Mar 2023 12:33:11 +0100 Subject: [PATCH] FIR2IR: make anonymous object constructor public to match K1 behavior --- .../fir/backend/Fir2IrDeclarationStorage.kt | 3 +- ...mbdaInDataClassDefaultParameter.fir.ir.txt | 4 +- ...mbdaInDataClassDefaultParameter.fir.kt.txt | 2 +- .../delegatedImplementation.fir.ir.txt | 4 +- .../delegatedImplementation.fir.kt.txt | 2 +- .../ir/irText/classes/kt43217.fir.ir.txt | 4 +- .../ir/irText/classes/kt43217.fir.kt.txt | 2 +- .../objectLiteralExpressions.fir.ir.txt | 192 ------------------ .../objectLiteralExpressions.fir.kt.txt | 94 --------- .../classes/objectLiteralExpressions.kt | 1 + ...ntryReferenceFromEnumEntryClass.fir.ir.txt | 4 +- ...ntryReferenceFromEnumEntryClass.fir.kt.txt | 2 +- .../funInterface/partialSam.fir.ir.txt | 8 +- .../funInterface/partialSam.fir.kt.txt | 4 +- .../multipleThisReferences.fir.ir.txt | 134 ------------ .../multipleThisReferences.fir.kt.txt | 53 ----- .../expressions/multipleThisReferences.kt | 1 + .../expressions/objectReference.fir.ir.txt | 4 +- .../expressions/objectReference.fir.kt.txt | 2 +- .../thisOfGenericOuterClass.fir.ir.txt | 4 +- .../thisOfGenericOuterClass.fir.kt.txt | 2 +- ...hisReferenceBeforeClassDeclared.fir.ir.txt | 95 --------- ...hisReferenceBeforeClassDeclared.fir.kt.txt | 48 ----- .../thisReferenceBeforeClassDeclared.kt | 1 + .../firProblems/AnnotationLoader.fir.ir.txt | 12 +- .../firProblems/AnnotationLoader.fir.kt.txt | 6 +- ...nymousAsReturnOfGenericFunction.fir.ir.txt | 46 ----- ...nymousAsReturnOfGenericFunction.fir.kt.txt | 22 -- .../AnonymousAsReturnOfGenericFunction.kt | 1 + .../ir/irText/firProblems/ArrayMap.fir.ir.txt | 12 +- .../ir/irText/firProblems/ArrayMap.fir.kt.txt | 6 +- .../firProblems/FlushFromAnonymous.fir.ir.txt | 4 +- .../firProblems/FlushFromAnonymous.fir.kt.txt | 2 +- .../InnerClassInAnonymous.fir.ir.txt | 4 +- .../InnerClassInAnonymous.fir.kt.txt | 2 +- ...localClassUsedBeforeDeclaration.fir.ir.txt | 72 ------- ...localClassUsedBeforeDeclaration.fir.kt.txt | 31 --- .../localClassUsedBeforeDeclaration.kt | 1 + .../firProblems/readWriteProperty.fir.ir.txt | 4 +- .../firProblems/readWriteProperty.fir.kt.txt | 2 +- ...otationOnDefaultMethodParameter.fir.ir.txt | 4 +- ...otationOnDefaultMethodParameter.fir.kt.txt | 2 +- .../types/definitelyNonNullSAM.fir.ir.txt | 4 +- .../genericDelegatedDeepProperty.fir.ir.txt | 12 +- .../genericDelegatedDeepProperty.fir.kt.txt | 6 +- 45 files changed, 72 insertions(+), 853 deletions(-) delete mode 100644 compiler/testData/ir/irText/classes/objectLiteralExpressions.fir.ir.txt delete mode 100644 compiler/testData/ir/irText/classes/objectLiteralExpressions.fir.kt.txt delete mode 100644 compiler/testData/ir/irText/expressions/multipleThisReferences.fir.ir.txt delete mode 100644 compiler/testData/ir/irText/expressions/multipleThisReferences.fir.kt.txt delete mode 100644 compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.fir.ir.txt delete mode 100644 compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.fir.kt.txt delete mode 100644 compiler/testData/ir/irText/firProblems/AnonymousAsReturnOfGenericFunction.fir.ir.txt delete mode 100644 compiler/testData/ir/irText/firProblems/AnonymousAsReturnOfGenericFunction.fir.kt.txt delete mode 100644 compiler/testData/ir/irText/firProblems/localClassUsedBeforeDeclaration.fir.ir.txt delete mode 100644 compiler/testData/ir/irText/firProblems/localClassUsedBeforeDeclaration.fir.kt.txt 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 4e8b2ac6759..5dca5579470 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 @@ -633,12 +633,13 @@ class Fir2IrDeclarationStorage( runUnless(isLocal || !generateSignatures) { signatureComposer.composeSignature(constructor, forceTopLevelPrivate = forceTopLevelPrivate) } + val visibility = if (irParent.isAnonymousObject) Visibilities.Public else constructor.visibility val created = constructor.convertWithOffsets { startOffset, endOffset -> declareIrConstructor(signature) { symbol -> classifierStorage.preCacheTypeParameters(constructor, symbol) irFactory.createConstructor( startOffset, endOffset, origin, symbol, - SpecialNames.INIT, components.visibilityConverter.convertToDescriptorVisibility(constructor.visibility), + SpecialNames.INIT, components.visibilityConverter.convertToDescriptorVisibility(visibility), constructor.returnTypeRef.toIrType(), isInline = false, isExternal = false, isPrimary = isPrimary, isExpect = constructor.isExpect ).apply { diff --git a/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.ir.txt index b160ff23930..9e04c02b05f 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.ir.txt @@ -104,7 +104,7 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt BLOCK type=.B.. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B.. - CONSTRUCTOR visibility:private <> () returnType:.B.. [primary] + CONSTRUCTOR visibility:public <> () returnType:.B.. [primary] 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]' @@ -121,7 +121,7 @@ FILE fqName: fileName:/lambdaInDataClassDefaultParameter.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .B..' type=.B.. origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .B..' type=.B.. origin=OBJECT_LITERAL BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' diff --git a/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.kt.txt index 275779bf357..941f486de08 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/lambdaInDataClassDefaultParameter.fir.kt.txt @@ -47,7 +47,7 @@ data class A { data class B { constructor(x: Any = { // BLOCK local class { - private constructor() /* primary */ { + constructor() /* primary */ { super/*Any*/() /* () */ diff --git a/compiler/testData/ir/irText/classes/delegatedImplementation.fir.ir.txt b/compiler/testData/ir/irText/classes/delegatedImplementation.fir.ir.txt index f09b4cf8450..0e840c525f0 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementation.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementation.fir.ir.txt @@ -112,7 +112,7 @@ FILE fqName: fileName:/delegatedImplementation.kt BLOCK type=.otherImpl. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IOther] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.otherImpl. - CONSTRUCTOR visibility:private <> () returnType:.otherImpl. [primary] + CONSTRUCTOR visibility:public <> () returnType:.otherImpl. [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IOther]' @@ -201,7 +201,7 @@ FILE fqName: fileName:/delegatedImplementation.kt overridden: public open fun toString (): kotlin.String [fake_override] declared in .IOther $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .otherImpl.' type=.otherImpl. origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .otherImpl.' type=.otherImpl. origin=OBJECT_LITERAL CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.IBase] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 CONSTRUCTOR visibility:public <> () returnType:.Test1 [primary] diff --git a/compiler/testData/ir/irText/classes/delegatedImplementation.fir.kt.txt b/compiler/testData/ir/irText/classes/delegatedImplementation.fir.kt.txt index 42ca34226c5..0830ef5199f 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementation.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementation.fir.kt.txt @@ -44,7 +44,7 @@ interface IOther { fun otherImpl(x0: String, y0: Int): IOther { return { // BLOCK local class : IOther { - private constructor() /* primary */ { + constructor() /* primary */ { super/*Any*/() /* () */ diff --git a/compiler/testData/ir/irText/classes/kt43217.fir.ir.txt b/compiler/testData/ir/irText/classes/kt43217.fir.ir.txt index 27338cfe234..ccad1c79bda 100644 --- a/compiler/testData/ir/irText/classes/kt43217.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/kt43217.fir.ir.txt @@ -11,7 +11,7 @@ FILE fqName: fileName:/kt43217.kt BLOCK type=.A.b. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.DoubleExpression] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A.b. - CONSTRUCTOR visibility:private <> () returnType:.A.b. [primary] + CONSTRUCTOR visibility:public <> () returnType:.A.b. [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .DoubleExpression' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.DoubleExpression]' @@ -52,7 +52,7 @@ FILE fqName: fileName:/kt43217.kt overridden: public open fun toString (): kotlin.String [fake_override] declared in .DoubleExpression $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .A.b.' type=.A.b. origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .A.b.' type=.A.b. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.A) returnType:.A.b. correspondingProperty: PROPERTY name:b visibility:private modality:FINAL [val] $this: VALUE_PARAMETER name: type:.A diff --git a/compiler/testData/ir/irText/classes/kt43217.fir.kt.txt b/compiler/testData/ir/irText/classes/kt43217.fir.kt.txt index b06efa5b888..5d82e859d36 100644 --- a/compiler/testData/ir/irText/classes/kt43217.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/kt43217.fir.kt.txt @@ -8,7 +8,7 @@ class A { private val b: field = { // BLOCK local class : DoubleExpression { - private constructor() /* primary */ { + constructor() /* primary */ { super/*DoubleExpression*/() /* () */ diff --git a/compiler/testData/ir/irText/classes/objectLiteralExpressions.fir.ir.txt b/compiler/testData/ir/irText/classes/objectLiteralExpressions.fir.ir.txt deleted file mode 100644 index b729bfd8eeb..00000000000 --- a/compiler/testData/ir/irText/classes/objectLiteralExpressions.fir.ir.txt +++ /dev/null @@ -1,192 +0,0 @@ -FILE fqName: fileName:/objectLiteralExpressions.kt - CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.IFoo - 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 - $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 [fake_override] - 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 [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - PROPERTY name:test1 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Any visibility:private [final,static] - EXPRESSION_BODY - BLOCK type=.test1. origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.test1. - CONSTRUCTOR visibility:private <> () returnType:.test1. [primary] - 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]' - 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 - $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 [fake_override] - 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 [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .test1.' type=.test1. origin=OBJECT_LITERAL - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Any - correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Any visibility:private [final,static]' type=kotlin.Any origin=null - PROPERTY name:test2 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test2 type:.IFoo visibility:private [final,static] - EXPRESSION_BODY - BLOCK type=.test2. origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IFoo] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.test2. - CONSTRUCTOR visibility:private <> () returnType:.test2. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IFoo]' - FUN name:foo visibility:public modality:OPEN <> ($this:.test2.) returnType:kotlin.Unit - overridden: - public abstract fun foo (): kotlin.Unit declared in .IFoo - $this: VALUE_PARAMETER name: type:.test2. - BLOCK_BODY - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io.ConsoleKt' type=kotlin.Unit origin=null - message: CONST String type=kotlin.String value="foo" - 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 [fake_override,operator] declared in .IFoo - $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 [fake_override] - overridden: - public open fun hashCode (): kotlin.Int [fake_override] declared in .IFoo - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String [fake_override] declared in .IFoo - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .test2.' type=.test2. origin=OBJECT_LITERAL - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.IFoo - correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .IFoo declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:.IFoo visibility:private [final,static]' type=.IFoo origin=null - CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer - CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - 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 <> ($this:.Outer) returnType:.Outer.Inner [primary] - $outer: VALUE_PARAMETER name: type:.Outer - 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]' - FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.Unit [fake_override] - overridden: - public abstract fun foo (): kotlin.Unit declared in .IFoo - $this: VALUE_PARAMETER name: type:.IFoo - 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 [fake_override,operator] declared in .IFoo - $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 [fake_override] - overridden: - public open fun hashCode (): kotlin.Int [fake_override] declared in .IFoo - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String [fake_override] declared in .IFoo - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:test3 visibility:public modality:FINAL <> ($this:.Outer) returnType:.Outer.Inner - $this: VALUE_PARAMETER name: type:.Outer - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test3 (): .Outer.Inner declared in .Outer' - BLOCK type=.Outer.test3. origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Outer.Inner] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.test3. - CONSTRUCTOR visibility:private <> () returnType:.Outer.test3. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Outer.Inner' - $this: GET_VAR ': .Outer declared in .Outer.test3' type=.Outer origin=null - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Outer.Inner]' - FUN name:foo visibility:public modality:OPEN <> ($this:.Outer.test3.) returnType:kotlin.Unit - overridden: - public abstract fun foo (): kotlin.Unit [fake_override] declared in .Outer.Inner - $this: VALUE_PARAMETER name: type:.Outer.test3. - BLOCK_BODY - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io.ConsoleKt' type=kotlin.Unit origin=null - message: CONST String type=kotlin.String value="foo" - 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 [fake_override,operator] declared in .Outer.Inner - $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 [fake_override] - overridden: - public open fun hashCode (): kotlin.Int [fake_override] declared in .Outer.Inner - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String [fake_override] declared in .Outer.Inner - $this: VALUE_PARAMETER name: type:kotlin.Any - 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 - $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 [fake_override] - 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 [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:test4 visibility:public modality:FINAL <> ($receiver:.Outer) returnType:.Outer.Inner - $receiver: VALUE_PARAMETER name: type:.Outer - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test4 (): .Outer.Inner declared in ' - BLOCK type=.test4. origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Outer.Inner] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.test4. - CONSTRUCTOR visibility:private <> () returnType:.test4. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Outer.Inner' - $this: GET_VAR ': .Outer declared in .test4' type=.Outer origin=null - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Outer.Inner]' - FUN name:foo visibility:public modality:OPEN <> ($this:.test4.) returnType:kotlin.Unit - overridden: - public abstract fun foo (): kotlin.Unit [fake_override] declared in .Outer.Inner - $this: VALUE_PARAMETER name: type:.test4. - BLOCK_BODY - CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io.ConsoleKt' type=kotlin.Unit origin=null - message: CONST String type=kotlin.String value="foo" - 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 [fake_override,operator] declared in .Outer.Inner - $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 [fake_override] - overridden: - public open fun hashCode (): kotlin.Int [fake_override] declared in .Outer.Inner - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String [fake_override] declared in .Outer.Inner - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .test4.' type=.test4. origin=OBJECT_LITERAL diff --git a/compiler/testData/ir/irText/classes/objectLiteralExpressions.fir.kt.txt b/compiler/testData/ir/irText/classes/objectLiteralExpressions.fir.kt.txt deleted file mode 100644 index 693175fa5f8..00000000000 --- a/compiler/testData/ir/irText/classes/objectLiteralExpressions.fir.kt.txt +++ /dev/null @@ -1,94 +0,0 @@ -interface IFoo { - abstract fun foo() - -} - -val test1: Any - field = { // BLOCK - local class { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - } - - () - } - get - -val test2: IFoo - field = { // BLOCK - local class : IFoo { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - override fun foo() { - println(message = "foo") - } - - } - - () - } - get - -class Outer { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - abstract inner class Inner : IFoo { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - } - - fun test3(): Inner { - return { // BLOCK - local class : Inner { - private constructor() /* primary */ { - .super/*Inner*/() - /* () */ - - } - - override fun foo() { - println(message = "foo") - } - - } - - () - } - } - -} - -fun Outer.test4(): Inner { - return { // BLOCK - local class : Inner { - private constructor() /* primary */ { - .super/*Inner*/() - /* () */ - - } - - override fun foo() { - println(message = "foo") - } - - } - - () - } -} diff --git a/compiler/testData/ir/irText/classes/objectLiteralExpressions.kt b/compiler/testData/ir/irText/classes/objectLiteralExpressions.kt index faca35e7410..fb03ffe9814 100644 --- a/compiler/testData/ir/irText/classes/objectLiteralExpressions.kt +++ b/compiler/testData/ir/irText/classes/objectLiteralExpressions.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // WITH_STDLIB interface IFoo { diff --git a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.ir.txt b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.ir.txt index da18d149b87..b955d3690a5 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.ir.txt @@ -69,7 +69,7 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt BLOCK type=.MyEnum.Z.anObject. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyEnum.Z.anObject. - CONSTRUCTOR visibility:private <> () returnType:.MyEnum.Z.anObject. [primary] + CONSTRUCTOR visibility:public <> () returnType:.MyEnum.Z.anObject. [primary] 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]' @@ -101,7 +101,7 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .MyEnum.Z.anObject.' type=.MyEnum.Z.anObject. origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .MyEnum.Z.anObject.' type=.MyEnum.Z.anObject. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.MyEnum.Z) returnType:.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/enumEntryReferenceFromEnumEntryClass.fir.kt.txt b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.kt.txt index bcd4f339770..c803ce97113 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.kt.txt @@ -37,7 +37,7 @@ open enum class MyEnum : Enum { val anObject: field = { // BLOCK local class { - private constructor() /* primary */ { + constructor() /* primary */ { super/*Any*/() /* () */ diff --git a/compiler/testData/ir/irText/expressions/funInterface/partialSam.fir.ir.txt b/compiler/testData/ir/irText/expressions/funInterface/partialSam.fir.ir.txt index 4c92f44bafb..89e3e46cdd9 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/partialSam.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/partialSam.fir.ir.txt @@ -61,7 +61,7 @@ FILE fqName: fileName:/partialSam.kt BLOCK type=.fsi. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Fn] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.fsi. - CONSTRUCTOR visibility:private <> () returnType:.fsi. [primary] + CONSTRUCTOR visibility:public <> () returnType:.fsi. [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Fn]' @@ -88,7 +88,7 @@ FILE fqName: fileName:/partialSam.kt overridden: public open fun toString (): kotlin.String [fake_override] declared in .Fn $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .fsi.' type=.fsi. origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .fsi.' type=.fsi. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.Fn correspondingProperty: PROPERTY name:fsi visibility:public modality:FINAL [val] BLOCK_BODY @@ -100,7 +100,7 @@ FILE fqName: fileName:/partialSam.kt BLOCK type=.fis. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Fn] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.fis. - CONSTRUCTOR visibility:private <> () returnType:.fis. [primary] + CONSTRUCTOR visibility:public <> () returnType:.fis. [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Fn]' @@ -127,7 +127,7 @@ FILE fqName: fileName:/partialSam.kt overridden: public open fun toString (): kotlin.String [fake_override] declared in .Fn $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .fis.' type=.fis. origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .fis.' type=.fis. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.Fn correspondingProperty: PROPERTY name:fis visibility:public modality:FINAL [val] BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/funInterface/partialSam.fir.kt.txt b/compiler/testData/ir/irText/expressions/funInterface/partialSam.fir.kt.txt index cd1a19710b7..e0dfeedb75b 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/partialSam.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/partialSam.fir.kt.txt @@ -19,7 +19,7 @@ class J { val fsi: Fn field = { // BLOCK local class : Fn { - private constructor() /* primary */ { + constructor() /* primary */ { super/*Any*/() /* () */ @@ -38,7 +38,7 @@ val fsi: Fn val fis: Fn field = { // BLOCK local class : Fn { - private constructor() /* primary */ { + constructor() /* primary */ { super/*Any*/() /* () */ diff --git a/compiler/testData/ir/irText/expressions/multipleThisReferences.fir.ir.txt b/compiler/testData/ir/irText/expressions/multipleThisReferences.fir.ir.txt deleted file mode 100644 index 520cbe9d86c..00000000000 --- a/compiler/testData/ir/irText/expressions/multipleThisReferences.fir.ir.txt +++ /dev/null @@ -1,134 +0,0 @@ -FILE fqName: fileName:/multipleThisReferences.kt - CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer - CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - 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 <> ($this:.Outer, x:kotlin.Int) returnType:.Outer.Inner [primary] - $outer: VALUE_PARAMETER name: type:.Outer - VALUE_PARAMETER name:x index:0 type:kotlin.Int - 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]' - PROPERTY name:x visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] - EXPRESSION_BODY - GET_VAR 'x: kotlin.Int declared in .Outer.Inner.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Outer.Inner) returnType:kotlin.Int - correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Outer.Inner - BLOCK_BODY - 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 - 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 - $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 [fake_override] - 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 [fake_override] - 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 [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] 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 [fake_override] - 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 [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host - CONSTRUCTOR visibility:public <> (y:kotlin.Int) returnType:.Host [primary] - VALUE_PARAMETER name:y index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:y visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final] - EXPRESSION_BODY - GET_VAR 'y: kotlin.Int declared in .Host.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.Int - correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Host - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Host' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .Host declared in .Host.' type=.Host origin=null - FUN name:test visibility:public modality:FINAL <> ($this:.Host, $receiver:.Outer) returnType:.Outer.Inner - $this: VALUE_PARAMETER name: type:.Host - $receiver: VALUE_PARAMETER name: type:.Outer - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test (): .Outer.Inner declared in .Host' - BLOCK type=.Host.test. origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Outer.Inner] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host.test. - CONSTRUCTOR visibility:private <> () returnType:.Host.test. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int) [primary] declared in .Outer.Inner' - $this: GET_VAR ': .Outer declared in .Host.test' type=.Outer origin=null - x: CONST Int type=kotlin.Int value=42 - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Outer.Inner]' - PROPERTY name:xx visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:xx type:kotlin.Int visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS - $this: CALL 'public final fun (): kotlin.Int [fake_override] declared in .Host.test.' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .Host.test. declared in .Host.test.' type=.Host.test. origin=null - other: CALL 'public final fun (): kotlin.Int declared in .Host' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .Host declared in .Host.test' type=.Host origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Host.test.) returnType:kotlin.Int - correspondingProperty: PROPERTY name:xx visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Host.test. - BLOCK_BODY - 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 - PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final x: kotlin.Int [val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Outer.Inner) returnType:kotlin.Int [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): kotlin.Int declared in .Outer.Inner - $this: VALUE_PARAMETER name: type:.Outer.Inner - 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 [fake_override,operator] declared in .Outer.Inner - $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 [fake_override] - overridden: - public open fun hashCode (): kotlin.Int [fake_override] declared in .Outer.Inner - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String [fake_override] declared in .Outer.Inner - $this: VALUE_PARAMETER name: type:kotlin.Any - 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 - $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 [fake_override] - 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 [fake_override] - 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/multipleThisReferences.fir.kt.txt b/compiler/testData/ir/irText/expressions/multipleThisReferences.fir.kt.txt deleted file mode 100644 index 64218022524..00000000000 --- a/compiler/testData/ir/irText/expressions/multipleThisReferences.fir.kt.txt +++ /dev/null @@ -1,53 +0,0 @@ -class Outer { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - open inner class Inner { - constructor(x: Int) /* primary */ { - super/*Any*/() - /* () */ - - } - - val x: Int - field = x - get - - } - -} - -class Host { - constructor(y: Int) /* primary */ { - super/*Any*/() - /* () */ - - } - - val y: Int - field = y - get - - fun Outer.test(): Inner { - return { // BLOCK - local class : Inner { - private constructor() /* primary */ { - .super/*Inner*/(x = 42) - /* () */ - - } - - val xx: Int - field = .().plus(other = .()) - get - - } - - () - } - } - -} diff --git a/compiler/testData/ir/irText/expressions/multipleThisReferences.kt b/compiler/testData/ir/irText/expressions/multipleThisReferences.kt index 70b0fbeb3bb..eda4a90b104 100644 --- a/compiler/testData/ir/irText/expressions/multipleThisReferences.kt +++ b/compiler/testData/ir/irText/expressions/multipleThisReferences.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Outer { open inner class Inner(val x: Int) } diff --git a/compiler/testData/ir/irText/expressions/objectReference.fir.ir.txt b/compiler/testData/ir/irText/expressions/objectReference.fir.ir.txt index 5cd4d0318f4..909ebe3ff27 100644 --- a/compiler/testData/ir/irText/expressions/objectReference.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/objectReference.fir.ir.txt @@ -113,7 +113,7 @@ FILE fqName: fileName:/objectReference.kt BLOCK type=.Z.anObject. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z.anObject. - CONSTRUCTOR visibility:private <> () returnType:.Z.anObject. [primary] + CONSTRUCTOR visibility:public <> () returnType:.Z.anObject. [primary] 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]' @@ -155,7 +155,7 @@ FILE fqName: fileName:/objectReference.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .Z.anObject.' type=.Z.anObject. origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Z.anObject.' type=.Z.anObject. origin=OBJECT_LITERAL FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Z) returnType:kotlin.Any correspondingProperty: PROPERTY name:anObject visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.Z diff --git a/compiler/testData/ir/irText/expressions/objectReference.fir.kt.txt b/compiler/testData/ir/irText/expressions/objectReference.fir.kt.txt index 518effa0539..a962e5b2fa8 100644 --- a/compiler/testData/ir/irText/expressions/objectReference.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/objectReference.fir.kt.txt @@ -56,7 +56,7 @@ object Z { val anObject: Any field = { // BLOCK local class { - private constructor() /* primary */ { + constructor() /* primary */ { super/*Any*/() /* () */ diff --git a/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.fir.ir.txt b/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.fir.ir.txt index c0b95b09b94..9aa6d9d3dcf 100644 --- a/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.fir.ir.txt @@ -70,7 +70,7 @@ FILE fqName: fileName:/thisOfGenericOuterClass.kt BLOCK type=.test. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Outer.Inner] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.test. - CONSTRUCTOR visibility:private <> () returnType:.test. [primary] + CONSTRUCTOR visibility:public <> () returnType:.test. [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor (y: kotlin.Int) [primary] declared in .Outer.Inner' $this: GET_VAR ': .Outer declared in .test' type=.Outer origin=null @@ -112,4 +112,4 @@ FILE fqName: fileName:/thisOfGenericOuterClass.kt overridden: public open fun toString (): kotlin.String [fake_override] declared in .Outer.Inner $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .test.' type=.test. origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .test.' type=.test. origin=OBJECT_LITERAL diff --git a/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.fir.kt.txt b/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.fir.kt.txt index 1f36002c48d..767928e903f 100644 --- a/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.fir.kt.txt @@ -27,7 +27,7 @@ class Outer { fun Outer.test(): Inner { return { // BLOCK local class : Inner { - private constructor() /* primary */ { + constructor() /* primary */ { .super/*Inner*/(y = 42) /* () */ diff --git a/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.fir.ir.txt b/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.fir.ir.txt deleted file mode 100644 index 2f12e7ebccf..00000000000 --- a/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.fir.ir.txt +++ /dev/null @@ -1,95 +0,0 @@ -FILE fqName: fileName:/thisReferenceBeforeClassDeclared.kt - FUN name:test visibility:public modality:FINAL <> ($receiver:.WithCompanion) returnType:kotlin.Unit - $receiver: VALUE_PARAMETER name: type:.WithCompanion - BLOCK_BODY - VAR name:test1 type:.test. [val] - BLOCK type=.test. origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[.WithCompanion] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.test. - CONSTRUCTOR visibility:private <> () returnType:.test. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (a: .WithCompanion.Companion) [primary] declared in .WithCompanion' - a: GET_OBJECT 'CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=.WithCompanion.Companion - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.WithCompanion]' - 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 [fake_override,operator] declared in .WithCompanion - $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 [fake_override] - overridden: - public open fun hashCode (): kotlin.Int [fake_override] declared in .WithCompanion - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String [fake_override] declared in .WithCompanion - $this: VALUE_PARAMETER name: type:kotlin.Any - 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] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.test. - CONSTRUCTOR visibility:private <> () returnType:.test. [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (a: .WithCompanion.Companion) [primary] declared in .WithCompanion' - a: CALL 'public final fun foo (): .WithCompanion.Companion declared in .WithCompanion.Companion' type=.WithCompanion.Companion origin=null - $this: GET_OBJECT 'CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=.WithCompanion.Companion - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.WithCompanion]' - 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 [fake_override,operator] declared in .WithCompanion - $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 [fake_override] - overridden: - public open fun hashCode (): kotlin.Int [fake_override] declared in .WithCompanion - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String [fake_override] declared in .WithCompanion - $this: VALUE_PARAMETER name: type:kotlin.Any - 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] - VALUE_PARAMETER name:a index:0 type:.WithCompanion.Companion - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:WithCompanion modality:OPEN visibility:public superTypes:[kotlin.Any]' - CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.WithCompanion.Companion - CONSTRUCTOR visibility:private <> () returnType:.WithCompanion.Companion [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:FINAL <> ($this:.WithCompanion.Companion) returnType:.WithCompanion.Companion - $this: VALUE_PARAMETER name: type:.WithCompanion.Companion - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (): .WithCompanion.Companion declared in .WithCompanion.Companion' - GET_VAR ': .WithCompanion.Companion declared in .WithCompanion.Companion.foo' type=.WithCompanion.Companion origin=null - 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 - $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 [fake_override] - 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 [fake_override] - 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 [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] 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 [fake_override] - 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 [fake_override] - 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/thisReferenceBeforeClassDeclared.fir.kt.txt b/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.fir.kt.txt deleted file mode 100644 index 9231a19a63d..00000000000 --- a/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.fir.kt.txt +++ /dev/null @@ -1,48 +0,0 @@ -fun WithCompanion.test() { - val test1: = { // BLOCK - local class : WithCompanion { - private constructor() /* primary */ { - super/*WithCompanion*/(a = Companion) - /* () */ - - } - - } - - () - } - val test2: = { // BLOCK - local class : WithCompanion { - private constructor() /* primary */ { - super/*WithCompanion*/(a = Companion.foo()) - /* () */ - - } - - } - - () - } -} - -open class WithCompanion { - constructor(a: Companion) /* primary */ { - super/*Any*/() - /* () */ - - } - - companion object Companion { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - fun foo(): Companion { - return - } - - } - -} diff --git a/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.kt b/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.kt index 9ecd279c30f..c6eea151f97 100644 --- a/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.kt +++ b/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun WithCompanion.test() { val test1 = object : WithCompanion(this) {} val test2 = object : WithCompanion(this.foo()) {} diff --git a/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.ir.txt b/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.ir.txt index e43452862a5..f4e42d6aa4c 100644 --- a/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.ir.txt @@ -39,7 +39,7 @@ FILE fqName: fileName:/AnnotationLoader.kt BLOCK type=.AnnotationLoader.loadAnnotation. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Visitor] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AnnotationLoader.loadAnnotation. - CONSTRUCTOR visibility:private <> () returnType:.AnnotationLoader.loadAnnotation. [primary] + CONSTRUCTOR visibility:public <> () returnType:.AnnotationLoader.loadAnnotation. [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Visitor]' @@ -57,7 +57,7 @@ FILE fqName: fileName:/AnnotationLoader.kt BLOCK type=.AnnotationLoader.loadAnnotation..visitArray. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Visitor] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AnnotationLoader.loadAnnotation..visitArray. - CONSTRUCTOR visibility:private <> () returnType:.AnnotationLoader.loadAnnotation..visitArray. [primary] + CONSTRUCTOR visibility:public <> () returnType:.AnnotationLoader.loadAnnotation..visitArray. [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Visitor]' @@ -89,7 +89,7 @@ FILE fqName: fileName:/AnnotationLoader.kt overridden: public open fun toString (): kotlin.String [fake_override] declared in .Visitor $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .AnnotationLoader.loadAnnotation..visitArray.' type=.AnnotationLoader.loadAnnotation..visitArray. origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .AnnotationLoader.loadAnnotation..visitArray.' type=.AnnotationLoader.loadAnnotation..visitArray. origin=OBJECT_LITERAL FUN name:visitAnnotation visibility:public modality:OPEN <> ($this:.AnnotationLoader.loadAnnotation.) returnType:.Visitor? overridden: public open fun visitAnnotation (): .Visitor? declared in .Visitor @@ -104,7 +104,7 @@ FILE fqName: fileName:/AnnotationLoader.kt BLOCK type=.AnnotationLoader.loadAnnotation..visitAnnotation. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Visitor] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.AnnotationLoader.loadAnnotation..visitAnnotation. - CONSTRUCTOR visibility:private <> () returnType:.AnnotationLoader.loadAnnotation..visitAnnotation. [primary] + CONSTRUCTOR visibility:public <> () returnType:.AnnotationLoader.loadAnnotation..visitAnnotation. [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Visitor]' @@ -147,7 +147,7 @@ FILE fqName: fileName:/AnnotationLoader.kt overridden: public open fun toString (): kotlin.String [fake_override] declared in .Visitor $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .AnnotationLoader.loadAnnotation..visitAnnotation.' type=.AnnotationLoader.loadAnnotation..visitAnnotation. origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .AnnotationLoader.loadAnnotation..visitAnnotation.' type=.AnnotationLoader.loadAnnotation..visitAnnotation. origin=OBJECT_LITERAL FUN name:foo visibility:private modality:FINAL <> ($this:.AnnotationLoader.loadAnnotation.) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.AnnotationLoader.loadAnnotation. BLOCK_BODY @@ -164,7 +164,7 @@ FILE fqName: fileName:/AnnotationLoader.kt overridden: public open fun toString (): kotlin.String [fake_override] declared in .Visitor $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .AnnotationLoader.loadAnnotation.' type=.AnnotationLoader.loadAnnotation. origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .AnnotationLoader.loadAnnotation.' type=.AnnotationLoader.loadAnnotation. 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/firProblems/AnnotationLoader.fir.kt.txt b/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.kt.txt index 2ae3a9976d6..17b686a9c7f 100644 --- a/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.kt.txt @@ -20,7 +20,7 @@ class AnnotationLoader { fun loadAnnotation(): Visitor? { return { // BLOCK local class : Visitor { - private constructor() /* primary */ { + constructor() /* primary */ { super/*Any*/() /* () */ @@ -32,7 +32,7 @@ class AnnotationLoader { override fun visitArray(): Visitor? { return { // BLOCK local class : Visitor { - private constructor() /* primary */ { + constructor() /* primary */ { super/*Any*/() /* () */ @@ -52,7 +52,7 @@ class AnnotationLoader { val visitor: Visitor = CHECK_NOT_NULL(arg0 = .loadAnnotation()) return { // BLOCK local class : Visitor { - private constructor() /* primary */ { + constructor() /* primary */ { super/*Any*/() /* () */ diff --git a/compiler/testData/ir/irText/firProblems/AnonymousAsReturnOfGenericFunction.fir.ir.txt b/compiler/testData/ir/irText/firProblems/AnonymousAsReturnOfGenericFunction.fir.ir.txt deleted file mode 100644 index 02cd9b32628..00000000000 --- a/compiler/testData/ir/irText/firProblems/AnonymousAsReturnOfGenericFunction.fir.ir.txt +++ /dev/null @@ -1,46 +0,0 @@ -FILE fqName: fileName:/AnonymousAsReturnOfGenericFunction.kt - CLASS INTERFACE name:NestedGroupFragment modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.NestedGroupFragment - 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 - $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 [fake_override] - 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 [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:addMavenOptionsGroupFragment visibility:private modality:FINAL <> () returnType:.addOptionsGroup. - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun addMavenOptionsGroupFragment (): .addOptionsGroup. declared in ' - CALL 'private final fun addOptionsGroup (): .addOptionsGroup..addOptionsGroup> declared in ' type=.addOptionsGroup. origin=null - : kotlin.Int - FUN name:addOptionsGroup visibility:private modality:FINAL () returnType:.addOptionsGroup..addOptionsGroup> - TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] reified:false - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun addOptionsGroup (): .addOptionsGroup..addOptionsGroup> declared in ' - BLOCK type=.addOptionsGroup..addOptionsGroup> origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[.NestedGroupFragment] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.addOptionsGroup..addOptionsGroup> - CONSTRUCTOR visibility:private <> () returnType:.addOptionsGroup..addOptionsGroup> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.NestedGroupFragment]' - 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 [fake_override,operator] declared in .NestedGroupFragment - $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 [fake_override] - overridden: - public open fun hashCode (): kotlin.Int [fake_override] declared in .NestedGroupFragment - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String [fake_override] declared in .NestedGroupFragment - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .addOptionsGroup.' type=.addOptionsGroup..addOptionsGroup> origin=OBJECT_LITERAL diff --git a/compiler/testData/ir/irText/firProblems/AnonymousAsReturnOfGenericFunction.fir.kt.txt b/compiler/testData/ir/irText/firProblems/AnonymousAsReturnOfGenericFunction.fir.kt.txt deleted file mode 100644 index 30b3a835ef8..00000000000 --- a/compiler/testData/ir/irText/firProblems/AnonymousAsReturnOfGenericFunction.fir.kt.txt +++ /dev/null @@ -1,22 +0,0 @@ -interface NestedGroupFragment { - -} - -private fun addMavenOptionsGroupFragment(): { - return addOptionsGroup() -} - -private fun addOptionsGroup(): { - return { // BLOCK - local class : NestedGroupFragment { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - } - - () - } -} diff --git a/compiler/testData/ir/irText/firProblems/AnonymousAsReturnOfGenericFunction.kt b/compiler/testData/ir/irText/firProblems/AnonymousAsReturnOfGenericFunction.kt index fc9f1bf1fc3..26f5a8401b6 100644 --- a/compiler/testData/ir/irText/firProblems/AnonymousAsReturnOfGenericFunction.kt +++ b/compiler/testData/ir/irText/firProblems/AnonymousAsReturnOfGenericFunction.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface NestedGroupFragment private fun addMavenOptionsGroupFragment() = addOptionsGroup() diff --git a/compiler/testData/ir/irText/firProblems/ArrayMap.fir.ir.txt b/compiler/testData/ir/irText/firProblems/ArrayMap.fir.ir.txt index 0be7ace445c..b438849feba 100644 --- a/compiler/testData/ir/irText/firProblems/ArrayMap.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/ArrayMap.fir.ir.txt @@ -108,7 +108,7 @@ FILE fqName: fileName:/ArrayMap.kt BLOCK type=.EmptyArrayMap.iterator. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.collections.Iterator] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.EmptyArrayMap.iterator. - CONSTRUCTOR visibility:private <> () returnType:.EmptyArrayMap.iterator. [primary] + CONSTRUCTOR visibility:public <> () returnType:.EmptyArrayMap.iterator. [primary] 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.collections.Iterator]' @@ -140,7 +140,7 @@ FILE fqName: fileName:/ArrayMap.kt overridden: public open fun toString (): kotlin.String [fake_override] declared in kotlin.collections.Iterator $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .EmptyArrayMap.iterator.' type=.EmptyArrayMap.iterator. origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .EmptyArrayMap.iterator.' type=.EmptyArrayMap.iterator. 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 [fake_override,operator] declared in .ArrayMap @@ -245,7 +245,7 @@ FILE fqName: fileName:/ArrayMap.kt BLOCK type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.collections.Iterator.OneElementArrayMap>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.OneElementArrayMap.iterator..OneElementArrayMap> - CONSTRUCTOR visibility:private <> () returnType:.OneElementArrayMap.iterator..OneElementArrayMap> [primary] + CONSTRUCTOR visibility:public <> () returnType:.OneElementArrayMap.iterator..OneElementArrayMap> [primary] 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.collections.Iterator.OneElementArrayMap>]' @@ -309,7 +309,7 @@ FILE fqName: fileName:/ArrayMap.kt overridden: public open fun toString (): kotlin.String [fake_override] declared in kotlin.collections.Iterator $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .OneElementArrayMap.iterator.' type=.OneElementArrayMap.iterator..OneElementArrayMap> origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .OneElementArrayMap.iterator.' type=.OneElementArrayMap.iterator..OneElementArrayMap> 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 [fake_override,operator] declared in .ArrayMap @@ -512,7 +512,7 @@ FILE fqName: fileName:/ArrayMap.kt BLOCK type=.ArrayMapImpl.iterator..ArrayMapImpl> origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.collections.AbstractIterator.ArrayMapImpl>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ArrayMapImpl.iterator..ArrayMapImpl> - CONSTRUCTOR visibility:private <> () returnType:.ArrayMapImpl.iterator..ArrayMapImpl> [primary] + CONSTRUCTOR visibility:public <> () returnType:.ArrayMapImpl.iterator..ArrayMapImpl> [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.collections.AbstractIterator' : T of .ArrayMapImpl @@ -620,7 +620,7 @@ FILE fqName: fileName:/ArrayMap.kt overridden: public open fun toString (): kotlin.String [fake_override] declared in kotlin.collections.AbstractIterator $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .ArrayMapImpl.iterator.' type=.ArrayMapImpl.iterator..ArrayMapImpl> origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .ArrayMapImpl.iterator.' type=.ArrayMapImpl.iterator..ArrayMapImpl> origin=OBJECT_LITERAL FUN name:remove visibility:public modality:FINAL <> ($this:.ArrayMapImpl.ArrayMapImpl>, index:kotlin.Int) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.ArrayMapImpl.ArrayMapImpl> VALUE_PARAMETER name:index index:0 type:kotlin.Int diff --git a/compiler/testData/ir/irText/firProblems/ArrayMap.fir.kt.txt b/compiler/testData/ir/irText/firProblems/ArrayMap.fir.kt.txt index ddedd156142..5b6bce3c1d0 100644 --- a/compiler/testData/ir/irText/firProblems/ArrayMap.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/ArrayMap.fir.kt.txt @@ -49,7 +49,7 @@ internal object EmptyArrayMap : ArrayMap { override operator fun iterator(): Iterator { return { // BLOCK local class : Iterator { - private constructor() /* primary */ { + constructor() /* primary */ { super/*Any*/() /* () */ @@ -109,7 +109,7 @@ internal class OneElementArrayMap : ArrayMap { override operator fun iterator(): Iterator { return { // BLOCK local class : Iterator { - private constructor() /* primary */ { + constructor() /* primary */ { super/*Any*/() /* () */ @@ -211,7 +211,7 @@ internal class ArrayMapImpl : ArrayMap { override operator fun iterator(): Iterator { return { // BLOCK local class : AbstractIterator { - private constructor() /* primary */ { + constructor() /* primary */ { super/*AbstractIterator*/() /* () */ diff --git a/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.fir.ir.txt b/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.fir.ir.txt index d66598790b4..542bb8c30f5 100644 --- a/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.fir.ir.txt @@ -25,7 +25,7 @@ FILE fqName: fileName:/FlushFromAnonymous.kt BLOCK type=.Serializer.createMessageCollector. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Collector] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Serializer.createMessageCollector. - CONSTRUCTOR visibility:private <> () returnType:.Serializer.createMessageCollector. [primary] + CONSTRUCTOR visibility:public <> () returnType:.Serializer.createMessageCollector. [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Collector' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Collector]' @@ -46,7 +46,7 @@ FILE fqName: fileName:/FlushFromAnonymous.kt overridden: public open fun toString (): kotlin.String [fake_override] declared in .Collector $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .Serializer.createMessageCollector.' type=.Serializer.createMessageCollector. origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Serializer.createMessageCollector.' type=.Serializer.createMessageCollector. 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/firProblems/FlushFromAnonymous.fir.kt.txt b/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.fir.kt.txt index 2c5f9340cdd..28f92c64e3d 100644 --- a/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/FlushFromAnonymous.fir.kt.txt @@ -18,7 +18,7 @@ class Serializer { private fun createMessageCollector(): { return { // BLOCK local class : Collector { - private constructor() /* primary */ { + constructor() /* primary */ { super/*Collector*/() /* () */ diff --git a/compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.fir.ir.txt b/compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.fir.ir.txt index b3cfa5a8d65..2d63fb2e022 100644 --- a/compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.fir.ir.txt @@ -5,7 +5,7 @@ FILE fqName: fileName:/InnerClassInAnonymous.kt BLOCK type=.box. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.box. - CONSTRUCTOR visibility:private <> () returnType:.box. [primary] + CONSTRUCTOR visibility:public <> () returnType:.box. [primary] 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]' @@ -113,7 +113,7 @@ FILE fqName: fileName:/InnerClassInAnonymous.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .box.' type=.box. origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .box.' type=.box. origin=OBJECT_LITERAL RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' CALL 'public final fun foo (): kotlin.String declared in .box.' type=kotlin.String origin=null $this: GET_VAR 'val obj: .box. [val] declared in .box' type=.box. origin=null diff --git a/compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.fir.kt.txt b/compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.fir.kt.txt index ed7485eda9e..04b3914c8a3 100644 --- a/compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/InnerClassInAnonymous.fir.kt.txt @@ -1,7 +1,7 @@ fun box(): String { val obj: = { // BLOCK local class { - private constructor() /* primary */ { + constructor() /* primary */ { super/*Any*/() /* () */ diff --git a/compiler/testData/ir/irText/firProblems/localClassUsedBeforeDeclaration.fir.ir.txt b/compiler/testData/ir/irText/firProblems/localClassUsedBeforeDeclaration.fir.ir.txt deleted file mode 100644 index 69d100e8338..00000000000 --- a/compiler/testData/ir/irText/firProblems/localClassUsedBeforeDeclaration.fir.ir.txt +++ /dev/null @@ -1,72 +0,0 @@ -FILE fqName: fileName:/localClassUsedBeforeDeclaration.kt - FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' - CALL 'public final fun (): kotlin.String declared in .box..A' type=kotlin.String origin=GET_PROPERTY - $this: CALL 'public final fun (): .box..A declared in .box.' type=.box..A origin=GET_PROPERTY - $this: BLOCK type=.box. origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.box. - CONSTRUCTOR visibility:private <> () returnType:.box. [primary] - 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]' - PROPERTY name:a visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:a type:.box..A visibility:private [final] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor (ok: kotlin.String) [primary] declared in .box..A' type=.box..A origin=null - $outer: GET_VAR ': .box. declared in .box.' type=.box. origin=null - ok: CONST String type=kotlin.String value="OK" - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.box.) returnType:.box..A - correspondingProperty: PROPERTY name:a visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.box. - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .box..A declared in .box.' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:.box..A visibility:private [final]' type=.box..A origin=null - receiver: GET_VAR ': .box. declared in .box..' type=.box. origin=null - CLASS CLASS name:A modality:FINAL visibility:local [inner] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.box..A - CONSTRUCTOR visibility:public <> ($this:.box., ok:kotlin.String) returnType:.box..A [primary] - $outer: VALUE_PARAMETER name: type:.box. - VALUE_PARAMETER name:ok index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:local [inner] superTypes:[kotlin.Any]' - PROPERTY name:ok visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:ok type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 'ok: kotlin.String declared in .box..A.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.box..A) returnType:kotlin.String - correspondingProperty: PROPERTY name:ok visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.box..A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .box..A' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ok type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .box..A declared in .box..A.' type=.box..A origin=null - 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 - $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 [fake_override] - 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 [fake_override] - 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 [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] 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 [fake_override] - 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 [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .box.' type=.box. origin=OBJECT_LITERAL diff --git a/compiler/testData/ir/irText/firProblems/localClassUsedBeforeDeclaration.fir.kt.txt b/compiler/testData/ir/irText/firProblems/localClassUsedBeforeDeclaration.fir.kt.txt deleted file mode 100644 index 2ef84cb6326..00000000000 --- a/compiler/testData/ir/irText/firProblems/localClassUsedBeforeDeclaration.fir.kt.txt +++ /dev/null @@ -1,31 +0,0 @@ -fun box(): String { - return { // BLOCK - local class { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - val a: A - field = .A(ok = "OK") - get - - local inner class A { - constructor(ok: String) /* primary */ { - super/*Any*/() - /* () */ - - } - - val ok: String - field = ok - get - - } - - } - - () - }.().() -} diff --git a/compiler/testData/ir/irText/firProblems/localClassUsedBeforeDeclaration.kt b/compiler/testData/ir/irText/firProblems/localClassUsedBeforeDeclaration.kt index 0e5a5c087fd..1576ddc5e54 100644 --- a/compiler/testData/ir/irText/firProblems/localClassUsedBeforeDeclaration.kt +++ b/compiler/testData/ir/irText/firProblems/localClassUsedBeforeDeclaration.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun box(): String { return object { val a = A("OK") diff --git a/compiler/testData/ir/irText/firProblems/readWriteProperty.fir.ir.txt b/compiler/testData/ir/irText/firProblems/readWriteProperty.fir.ir.txt index bab91e4f547..aecbcdbf627 100644 --- a/compiler/testData/ir/irText/firProblems/readWriteProperty.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/readWriteProperty.fir.ir.txt @@ -144,7 +144,7 @@ FILE fqName: fileName:/readWriteProperty.kt BLOCK type=.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.properties.ReadWriteProperty.IdeWizard.setting?>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> - CONSTRUCTOR visibility:private <> () returnType:.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> [primary] + CONSTRUCTOR visibility:public <> () returnType:.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> [primary] 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.properties.ReadWriteProperty.IdeWizard.setting?>]' @@ -196,7 +196,7 @@ FILE fqName: fileName:/readWriteProperty.kt overridden: public open fun toString (): kotlin.String [fake_override] declared in kotlin.properties.ReadWriteProperty $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .IdeWizard.setting.' type=.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .IdeWizard.setting.' type=.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> 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/firProblems/readWriteProperty.fir.kt.txt b/compiler/testData/ir/irText/firProblems/readWriteProperty.fir.kt.txt index 2dbbd701b66..7093200728b 100644 --- a/compiler/testData/ir/irText/firProblems/readWriteProperty.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/readWriteProperty.fir.kt.txt @@ -49,7 +49,7 @@ class IdeWizard { private fun > setting(reference: SettingReference): { return { // BLOCK local class : ReadWriteProperty { - private constructor() /* primary */ { + constructor() /* primary */ { super/*Any*/() /* () */ diff --git a/compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.fir.ir.txt b/compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.fir.ir.txt index 8024712dd41..ac0afe4e13a 100644 --- a/compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.fir.ir.txt @@ -5,7 +5,7 @@ FILE fqName: fileName:/reflectFindAnnotationOnDefaultMethodParameter.kt BLOCK type=.box. origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.I] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.box. - CONSTRUCTOR visibility:private <> () returnType:.box. [primary] + CONSTRUCTOR visibility:public <> () returnType:.box. [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.I]' @@ -29,7 +29,7 @@ FILE fqName: fileName:/reflectFindAnnotationOnDefaultMethodParameter.kt overridden: public open fun toString (): kotlin.String [fake_override] declared in .I $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .box.' type=.box. origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .box.' type=.box. origin=OBJECT_LITERAL VAR name:method type:@[FlexibleNullability] java.lang.reflect.Method? [val] CALL 'public open fun getMethod (p0: @[FlexibleNullability] kotlin.String?, vararg p1: @[FlexibleNullability] java.lang.Class<*>?): @[FlexibleNullability] java.lang.reflect.Method? declared in java.lang.Class' type=@[FlexibleNullability] java.lang.reflect.Method? origin=null $this: CALL 'public final fun (): java.lang.Class> [inline] declared in kotlin.jvm.JvmClassMappingKt' type=java.lang.Class<.box.> origin=GET_PROPERTY diff --git a/compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.fir.kt.txt b/compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.fir.kt.txt index c76d0053f64..0a692360576 100644 --- a/compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/reflectFindAnnotationOnDefaultMethodParameter.fir.kt.txt @@ -1,7 +1,7 @@ fun box(): String { val impl: = { // BLOCK local class : I { - private constructor() /* primary */ { + constructor() /* primary */ { super/*Any*/() /* () */ diff --git a/compiler/testData/ir/irText/types/definitelyNonNullSAM.fir.ir.txt b/compiler/testData/ir/irText/types/definitelyNonNullSAM.fir.ir.txt index 20adf06cf92..11d9656b71b 100644 --- a/compiler/testData/ir/irText/types/definitelyNonNullSAM.fir.ir.txt +++ b/compiler/testData/ir/irText/types/definitelyNonNullSAM.fir.ir.txt @@ -57,7 +57,7 @@ FILE fqName: fileName:/definitelyNonNullSAM.kt BLOCK type=.bar..bar> origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.FIn<{T of .bar & Any}>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.bar..bar> - CONSTRUCTOR visibility:private <> () returnType:.bar..bar> [primary] + CONSTRUCTOR visibility:public <> () returnType:.bar..bar> [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.FIn<{T of .bar & Any}>]' @@ -83,7 +83,7 @@ FILE fqName: fileName:/definitelyNonNullSAM.kt overridden: public open fun toString (): kotlin.String [fake_override] declared in .FIn $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .bar.' type=.bar..bar> origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .bar.' type=.bar..bar> origin=OBJECT_LITERAL CLASS INTERFACE name:I1 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I1.I1> TYPE_PARAMETER name:T index:0 variance:in superTypes:[kotlin.Any?] reified:false diff --git a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.ir.txt b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.ir.txt index bb44dcf89b3..4033fc08d30 100644 --- a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.ir.txt +++ b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.ir.txt @@ -203,7 +203,7 @@ FILE fqName: fileName:/genericDelegatedDeepProperty.kt BLOCK type=.additionalText$delegate..> origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value., .CR.>>, .P., T of .>>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.additionalText$delegate..> - CONSTRUCTOR visibility:private <> () returnType:.additionalText$delegate..> [primary] + CONSTRUCTOR visibility:public <> () returnType:.additionalText$delegate..> [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value., .CR.>>, .P., T of .>>]' @@ -228,7 +228,7 @@ FILE fqName: fileName:/genericDelegatedDeepProperty.kt BLOCK type=.additionalText$delegate..deepO$delegate..> origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value., .CR.>>, T of .>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.additionalText$delegate..deepO$delegate..> - CONSTRUCTOR visibility:private <> () returnType:.additionalText$delegate..deepO$delegate..> [primary] + CONSTRUCTOR visibility:public <> () returnType:.additionalText$delegate..deepO$delegate..> [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value., .CR.>>, T of .>]' @@ -270,7 +270,7 @@ FILE fqName: fileName:/genericDelegatedDeepProperty.kt overridden: public open fun toString (): kotlin.String [fake_override] declared in .IDelegate1 $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .additionalText$delegate..deepO$delegate.' type=.additionalText$delegate..deepO$delegate..> origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .additionalText$delegate..deepO$delegate.' type=.additionalText$delegate..deepO$delegate..> origin=OBJECT_LITERAL FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.additionalText$delegate..>, $receiver:.Value., .CR.>>) returnType:T of . correspondingProperty: PROPERTY name:deepO visibility:private modality:FINAL [delegated,val] $this: VALUE_PARAMETER name: type:.additionalText$delegate..> @@ -289,7 +289,7 @@ FILE fqName: fileName:/genericDelegatedDeepProperty.kt BLOCK type=.additionalText$delegate..deepK$delegate..> origin=OBJECT_LITERAL CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value., .CR.>>, T of .>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.additionalText$delegate..deepK$delegate..> - CONSTRUCTOR visibility:private <> () returnType:.additionalText$delegate..deepK$delegate..> [primary] + CONSTRUCTOR visibility:public <> () returnType:.additionalText$delegate..deepK$delegate..> [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value., .CR.>>, T of .>]' @@ -317,7 +317,7 @@ FILE fqName: fileName:/genericDelegatedDeepProperty.kt overridden: public open fun toString (): kotlin.String [fake_override] declared in .IDelegate1 $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .additionalText$delegate..deepK$delegate.' type=.additionalText$delegate..deepK$delegate..> origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .additionalText$delegate..deepK$delegate.' type=.additionalText$delegate..deepK$delegate..> origin=OBJECT_LITERAL FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.additionalText$delegate..>, $receiver:.Value., .CR.>>) returnType:T of . correspondingProperty: PROPERTY name:deepK visibility:private modality:FINAL [delegated,val] $this: VALUE_PARAMETER name: type:.additionalText$delegate..> @@ -360,7 +360,7 @@ FILE fqName: fileName:/genericDelegatedDeepProperty.kt overridden: public open fun toString (): kotlin.String [fake_override] declared in .IDelegate1 $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'private constructor () [primary] declared in .additionalText$delegate.' type=.additionalText$delegate..> origin=OBJECT_LITERAL + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .additionalText$delegate.' type=.additionalText$delegate..> origin=OBJECT_LITERAL FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL ($receiver:.Value., .CR.>>) returnType:.P., T of .> correspondingProperty: PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false diff --git a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.kt.txt b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.kt.txt index 7faa11e7792..55bc746ec4f 100644 --- a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.kt.txt +++ b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.kt.txt @@ -68,7 +68,7 @@ class P { val Value>.additionalText: P /* by */ field = { // BLOCK local class : IDelegate1>, P> { - private constructor() /* primary */ { + constructor() /* primary */ { super/*Any*/() /* () */ @@ -85,7 +85,7 @@ val Value>.additionalText: P /* by */ private val Value>.deepO: T /* by */ field = { // BLOCK local class : IDelegate1>, T> { - private constructor() /* primary */ { + constructor() /* primary */ { super/*Any*/() /* () */ @@ -114,7 +114,7 @@ val Value>.additionalText: P /* by */ private val Value>.deepK: T /* by */ field = { // BLOCK local class : IDelegate1>, T> { - private constructor() /* primary */ { + constructor() /* primary */ { super/*Any*/() /* () */