diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/localClassesWithImplicit.txt b/compiler/fir/analysis-tests/testData/resolve/cfg/localClassesWithImplicit.txt index 0984d0adba8..8fb0c6997b3 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/localClassesWithImplicit.txt +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/localClassesWithImplicit.txt @@ -51,7 +51,7 @@ FILE: localClassesWithImplicit.kt super() } - public final fun foo(): R|kotlin/Int| { + public[local] final fun foo(): R|kotlin/Int| { ^foo R|/myRun|( = myRun@fun (): R|kotlin/Int| { R|/a|.R|kotlin/String.length| ^ when () { @@ -68,7 +68,7 @@ FILE: localClassesWithImplicit.kt ) } - public final fun bar(): R|kotlin/Int| { + public[local] final fun bar(): R|kotlin/Int| { ^bar R|/myRun|( = myRun@fun (): R|kotlin/Int| { R|/a|.R|kotlin/String.length| R|/b|.# @@ -77,7 +77,7 @@ FILE: localClassesWithImplicit.kt ) } - public final fun baz(): R|kotlin/Int| { + public[local] final fun baz(): R|kotlin/Int| { ^baz Int(1) } diff --git a/compiler/fir/analysis-tests/testData/resolve/enum.txt b/compiler/fir/analysis-tests/testData/resolve/enum.txt index 5d081869343..33bc845d8b1 100644 --- a/compiler/fir/analysis-tests/testData/resolve/enum.txt +++ b/compiler/fir/analysis-tests/testData/resolve/enum.txt @@ -26,7 +26,7 @@ FILE: enum.kt super(Q|O1|) } - public final override fun check(y: R|Some|): R|kotlin/Boolean| { + public[local] final override fun check(y: R|Some|): R|kotlin/Boolean| { ^check Boolean(true) } @@ -37,7 +37,7 @@ FILE: enum.kt super(Q|O2|) } - public final override fun check(y: R|Some|): R|kotlin/Boolean| { + public[local] final override fun check(y: R|Some|): R|kotlin/Boolean| { ^check ==(R|/y|, Q|O2|) } @@ -75,11 +75,11 @@ FILE: enum.kt super() } - public final override fun foo(): R|kotlin/Int| { + public[local] final override fun foo(): R|kotlin/Int| { ^foo Int(1) } - public final override val bar: R|kotlin/String| = String(a) + public[local] final override val bar: R|kotlin/String| = String(a) public get(): R|kotlin/String| } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/CallBasedInExpressionGenerator.txt b/compiler/fir/analysis-tests/testData/resolve/expresssions/CallBasedInExpressionGenerator.txt index 87d620066f1..b7b48f3db29 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/CallBasedInExpressionGenerator.txt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/CallBasedInExpressionGenerator.txt @@ -34,12 +34,12 @@ FILE: CallBasedInExpressionGenerator.kt super(R|/argument|, Null(null), R|/argument|.#, #.#) } - public final override fun putSelector(type: R|ERROR CLASS: Symbol not found, for `Type`|, kotlinType: R|ERROR CLASS: Symbol not found, for `KotlinType?`|, v: R|ERROR CLASS: Symbol not found, for `InstructionAdapter`|): R|kotlin/Unit| { + public[local] final override fun putSelector(type: R|ERROR CLASS: Symbol not found, for `Type`|, kotlinType: R|ERROR CLASS: Symbol not found, for `KotlinType?`|, v: R|ERROR CLASS: Symbol not found, for `InstructionAdapter`|): R|kotlin/Unit| { this@R|/anonymous|.R|/anonymous.invokeFunction|(R|/v|) #(R|/type|, R|/kotlinType|, R|/v|) } - public final override fun condJump(jumpLabel: R|ERROR CLASS: Symbol not found, for `Label`|, v: R|ERROR CLASS: Symbol not found, for `InstructionAdapter`|, jumpIfFalse: R|kotlin/Boolean|): R|kotlin/Unit| { + public[local] final override fun condJump(jumpLabel: R|ERROR CLASS: Symbol not found, for `Label`|, v: R|ERROR CLASS: Symbol not found, for `InstructionAdapter`|, jumpIfFalse: R|kotlin/Boolean|): R|kotlin/Unit| { this@R|/anonymous|.R|/anonymous.invokeFunction|(R|/v|) R|/v|.#(when () { R|/jumpIfFalse| -> { diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/enumEntryUse.txt b/compiler/fir/analysis-tests/testData/resolve/expresssions/enumEntryUse.txt index f860c8aba1e..943f38a167c 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/enumEntryUse.txt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/enumEntryUse.txt @@ -11,7 +11,7 @@ FILE: enumEntryUse.kt super() } - public final fun foo(): R|kotlin/Unit| { + public[local] final fun foo(): R|kotlin/Unit| { } } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/localImplicitBodies.txt b/compiler/fir/analysis-tests/testData/resolve/expresssions/localImplicitBodies.txt index c157f059d60..95ffc549c3e 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/localImplicitBodies.txt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/localImplicitBodies.txt @@ -5,11 +5,11 @@ FILE: localImplicitBodies.kt super() } - public final fun sss(): R|kotlin/Int| { + public[local] final fun sss(): R|kotlin/Int| { ^sss this@R|/anonymous|.R|/anonymous.abc|() } - public final fun abc(): R|kotlin/Int| { + public[local] final fun abc(): R|kotlin/Int| { ^abc Int(1) } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/localInnerClass.txt b/compiler/fir/analysis-tests/testData/resolve/expresssions/localInnerClass.txt index c6503ef4801..f6f918e01bf 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/localInnerClass.txt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/localInnerClass.txt @@ -7,7 +7,7 @@ FILE: localInnerClass.kt super() } - public final fun foo(): R|Foo| { + public[local] final fun foo(): R|Foo| { ^foo this@R|/anonymous|.R|/.Derived.Derived|(Int(42)) } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/localScopes.txt b/compiler/fir/analysis-tests/testData/resolve/expresssions/localScopes.txt index d2d47a74119..779600d31ea 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/localScopes.txt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/localScopes.txt @@ -27,7 +27,7 @@ FILE: localScopes.kt super() } - public final fun baz(): R|kotlin/Unit| { + public[local] final fun baz(): R|kotlin/Unit| { } } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/localWithBooleanNot.txt b/compiler/fir/analysis-tests/testData/resolve/expresssions/localWithBooleanNot.txt index 78fd96a28ed..44d94294d47 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/localWithBooleanNot.txt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/localWithBooleanNot.txt @@ -9,11 +9,11 @@ FILE: foo.kt private get(): R|kotlin/Boolean| private set(value: R|kotlin/Boolean|): R|kotlin/Unit| - public final fun bar(): R|kotlin/Boolean| { + public[local] final fun bar(): R|kotlin/Boolean| { ^bar this@R|/anonymous|.R|/anonymous.result|.R|kotlin/Boolean.not|() } - public final override fun result(): R|kotlin/Boolean| { + public[local] final override fun result(): R|kotlin/Boolean| { ^result this@R|/anonymous|.R|/anonymous.result| } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/outerMemberAccesses.txt b/compiler/fir/analysis-tests/testData/resolve/expresssions/outerMemberAccesses.txt index 39eafdaf70d..90809515f91 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/outerMemberAccesses.txt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/outerMemberAccesses.txt @@ -36,16 +36,16 @@ FILE: O.kt super(this@R|/O.Derived.Some|.R|/O.Derived.Some.z|) } - public final fun local(): R|kotlin/Unit| { + public[local] final fun local(): R|kotlin/Unit| { lval y: R|ft!| = this@R|/O.Derived|.R|/Base.foo|() } - public final val oo: R|anonymous| = object : R|kotlin/Any| { + public[local] final val oo: R|anonymous| = object : R|kotlin/Any| { private constructor(): R|anonymous| { super() } - public final val zz: R|kotlin/Boolean| = this@R|/O.Derived.Some|.R|/O.Derived.Some.z| + public[local] final val zz: R|kotlin/Boolean| = this@R|/O.Derived.Some|.R|/O.Derived.Some.z| public get(): R|kotlin/Boolean| } @@ -65,7 +65,7 @@ FILE: O.kt super() } - public final fun local(): R|kotlin/Unit| { + public[local] final fun local(): R|kotlin/Unit| { lval y: R|ft!| = this@R|/O.Derived|.R|/Base.foo|() } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/privateObjectLiteral.txt b/compiler/fir/analysis-tests/testData/resolve/expresssions/privateObjectLiteral.txt index 03415b2c4c3..857d1deb645 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/privateObjectLiteral.txt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/privateObjectLiteral.txt @@ -9,7 +9,7 @@ FILE: privateObjectLiteral.kt super() } - public final fun foo(): R|kotlin/Int| { + public[local] final fun foo(): R|kotlin/Int| { ^foo Int(42) } @@ -25,7 +25,7 @@ FILE: privateObjectLiteral.kt super() } - public final fun foo(): R|kotlin/Int| { + public[local] final fun foo(): R|kotlin/Int| { ^foo Int(13) } diff --git a/compiler/fir/analysis-tests/testData/resolve/fromBuilder/enums.txt b/compiler/fir/analysis-tests/testData/resolve/fromBuilder/enums.txt index 63a3dbc682c..87e5d8d11e9 100644 --- a/compiler/fir/analysis-tests/testData/resolve/fromBuilder/enums.txt +++ b/compiler/fir/analysis-tests/testData/resolve/fromBuilder/enums.txt @@ -30,7 +30,7 @@ FILE: enums.kt super(Double(1.0), Double(2.0)) } - public final override fun sayHello(): R|kotlin/Unit| { + public[local] final override fun sayHello(): R|kotlin/Unit| { #(String(Hello!!!)) } @@ -41,7 +41,7 @@ FILE: enums.kt super(Double(3.0), Double(4.0)) } - public final override fun sayHello(): R|kotlin/Unit| { + public[local] final override fun sayHello(): R|kotlin/Unit| { #(String(Ola!!!)) } @@ -52,7 +52,7 @@ FILE: enums.kt super(Double(5.0), Double(6.0)) } - public final override fun sayHello(): R|kotlin/Unit| { + public[local] final override fun sayHello(): R|kotlin/Unit| { #(String(Privet!!!)) } diff --git a/compiler/fir/analysis-tests/testData/resolve/localClasses/implicitInAnonymous.txt b/compiler/fir/analysis-tests/testData/resolve/localClasses/implicitInAnonymous.txt index 10e344bc8fc..c9133118628 100644 --- a/compiler/fir/analysis-tests/testData/resolve/localClasses/implicitInAnonymous.txt +++ b/compiler/fir/analysis-tests/testData/resolve/localClasses/implicitInAnonymous.txt @@ -4,20 +4,20 @@ FILE: implicitInAnonymous.kt super() } - public final fun foo(x: R|kotlin/Int|): R|kotlin/Boolean| { + public[local] final fun foo(x: R|kotlin/Int|): R|kotlin/Boolean| { ^foo this@R|/anonymous|.R|/anonymous.bar|(R|/x|) } - public final fun bar(y: R|kotlin/Int|): R|kotlin/Boolean| { + public[local] final fun bar(y: R|kotlin/Int|): R|kotlin/Boolean| { ^bar CMP(>, this@R|/anonymous|.R|kotlin/Any.hashCode|().R|kotlin/Int.plus|(R|/y|).R|kotlin/Int.compareTo|(Int(0))) } - public final val w: R|kotlin/Boolean| + public[local] final val w: R|kotlin/Boolean| public get(): R|kotlin/Boolean| { ^ this@R|/anonymous|.R|/anonymous.z| } - public final val z: R|kotlin/Boolean| + public[local] final val z: R|kotlin/Boolean| public get(): R|kotlin/Boolean| { ^ ==(this@R|/anonymous|.R|kotlin/Any.hashCode|(), Int(0)) } diff --git a/compiler/fir/analysis-tests/testData/resolve/localObject.txt b/compiler/fir/analysis-tests/testData/resolve/localObject.txt index 184530e800a..79a845a75f4 100644 --- a/compiler/fir/analysis-tests/testData/resolve/localObject.txt +++ b/compiler/fir/analysis-tests/testData/resolve/localObject.txt @@ -13,7 +13,7 @@ FILE: localObject.kt super() } - public final override fun foo(): R|kotlin/Int| { + public[local] final override fun foo(): R|kotlin/Int| { ^foo R|/x|.R|kotlin/Int.plus|(Int(1)) } @@ -39,7 +39,7 @@ FILE: localObject.kt super() } - public final override fun foo(): R|kotlin/Int| { + public[local] final override fun foo(): R|kotlin/Int| { ^foo this@R|/TestProperty|.R|/TestProperty.intConst|.R|kotlin/Int.plus|(Int(1)) } @@ -55,7 +55,7 @@ FILE: localObject.kt super() } - public final override fun foo(): R|kotlin/Int| { + public[local] final override fun foo(): R|kotlin/Int| { ^foo this@R|/TestProperty|.R|/TestProperty.intConst|.R|kotlin/Int.plus|(Int(1)) } @@ -70,7 +70,7 @@ FILE: localObject.kt super() } - public final override fun foo(): R|kotlin/Int| { + public[local] final override fun foo(): R|kotlin/Int| { ^foo this@R|special/anonymous|.R|/TestProperty.x|.R|kotlin/Int.plus|(Int(1)) } diff --git a/compiler/fir/analysis-tests/testData/resolve/objectInnerClass.kt b/compiler/fir/analysis-tests/testData/resolve/objectInnerClass.kt index 22b8198f232..e62a32ee691 100644 --- a/compiler/fir/analysis-tests/testData/resolve/objectInnerClass.kt +++ b/compiler/fir/analysis-tests/testData/resolve/objectInnerClass.kt @@ -17,11 +17,11 @@ val case1 = object : A { hoo() } } - fun Child.voo() { + fun Child.voo() { val x = property } - fun Base.hoo() { + fun Base.hoo() { val x = property } @@ -111,10 +111,10 @@ class Case3() { } } - fun Child.voo() { + fun Child.voo() { val x = property } - fun Base.hoo() { + fun Base.hoo() { val x = property } diff --git a/compiler/fir/analysis-tests/testData/resolve/objectInnerClass.txt b/compiler/fir/analysis-tests/testData/resolve/objectInnerClass.txt index 5007adee213..557e1ab8051 100644 --- a/compiler/fir/analysis-tests/testData/resolve/objectInnerClass.txt +++ b/compiler/fir/analysis-tests/testData/resolve/objectInnerClass.txt @@ -22,11 +22,11 @@ FILE: objectInnerClass.kt } - public final fun R|.Child|.voo(): R|kotlin/Unit| { + public[local] final fun R|.Child|.voo(): R|kotlin/Unit| { lval x: R|B| = this@R|/anonymous.voo|.R|/.Base.property| } - public final fun R|.Base|.hoo(): R|kotlin/Unit| { + public[local] final fun R|.Base|.hoo(): R|kotlin/Unit| { lval x: R|B| = this@R|/anonymous.hoo|.R|/.Base.property| } @@ -43,14 +43,14 @@ FILE: objectInnerClass.kt } - public final fun caseForBase(): R|kotlin/Unit| { + public[local] final fun caseForBase(): R|kotlin/Unit| { lval base: R|.Base| = this@R|/anonymous|.R|/.Base.Base|(R|/B.B|()) R|/base|.R|/.Base.baseFun|() R|/base|.R|/.Base.property| (this@R|/anonymous|, R|/base|).R|/anonymous.hoo|() } - public final fun caseForChild(): R|kotlin/Unit| { + public[local] final fun caseForChild(): R|kotlin/Unit| { lval child: R|.Child| = this@R|/anonymous|.R|/.Child.Child|(R|/B.B|()) R|/child|.R|/.Base.baseFun|() R|/child|.R|/.Base.property| @@ -72,11 +72,11 @@ FILE: objectInnerClass.kt super(R|/B.B|()) } - public final fun R|Case2.Base|.zoo(): R|kotlin/Unit| { + public[local] final fun R|Case2.Base|.zoo(): R|kotlin/Unit| { lval x: R|B| = this@R|/anonymous.zoo|.R|/Case2.Base.property| } - public final fun foo(): R|kotlin/Unit| { + public[local] final fun foo(): R|kotlin/Unit| { this@R|/anonymous|.R|/Case2.Base.baseFun|() lval x: R|B| = this@R|/anonymous|.R|/Case2.Base.property| (this@R|/anonymous|, this@R|/anonymous|).R|/anonymous.zoo|() @@ -147,11 +147,11 @@ FILE: objectInnerClass.kt } - public final fun R|Case3..Child|.voo(): R|kotlin/Unit| { + public[local] final fun R|Case3..Child|.voo(): R|kotlin/Unit| { lval x: R|B| = this@R|/anonymous.voo|.R|/Case3..Base.property| } - public final fun R|Case3..Base|.hoo(): R|kotlin/Unit| { + public[local] final fun R|Case3..Base|.hoo(): R|kotlin/Unit| { lval x: R|B| = this@R|/anonymous.hoo|.R|/Case3..Base.property| } @@ -168,14 +168,14 @@ FILE: objectInnerClass.kt } - public final fun caseForBase(): R|kotlin/Unit| { + public[local] final fun caseForBase(): R|kotlin/Unit| { lval base: R|Case3..Base| = R|/Case3..Base.Base|(R|/B.B|()) R|/base|.R|/Case3..Base.baseFun|() R|/base|.R|/Case3..Base.property| (this@R|/anonymous|, R|/base|).R|/anonymous.hoo|() } - public final fun caseForChild(): R|kotlin/Unit| { + public[local] final fun caseForChild(): R|kotlin/Unit| { lval child: R|Case3..Child| = R|/Case3..Child.Child|(R|/B.B|()) R|/child|.R|/Case3..Base.baseFun|() R|/child|.R|/Case3..Base.property| diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/anonymousInDelegate.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/anonymousInDelegate.txt index d6cb9147079..f7f59c59f76 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/anonymousInDelegate.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/anonymousInDelegate.txt @@ -9,7 +9,7 @@ FILE: anonymousInDelegate.kt super() } - public final override fun bar(): R|kotlin/Int| { + public[local] final override fun bar(): R|kotlin/Int| { ^bar Int(42) } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.txt index 1d7c01dbf97..2f1be575953 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.txt @@ -28,11 +28,11 @@ FILE: delegateWithAnonymousObject.kt super() } - public final override fun getValue(thisRef: R|IssuesListUserProfile|, property: R|kotlin/reflect/KProperty<*>|): R|IssueListView| { + public[local] final override fun getValue(thisRef: R|IssuesListUserProfile|, property: R|kotlin/reflect/KProperty<*>|): R|IssueListView| { ^getValue R|/IssueListView.IssueListView|() } - public final override fun setValue(thisRef: R|IssuesListUserProfile|, property: R|kotlin/reflect/KProperty<*>|, value: R|IssueListView|): R|kotlin/Unit| { + public[local] final override fun setValue(thisRef: R|IssuesListUserProfile|, property: R|kotlin/reflect/KProperty<*>|, value: R|IssueListView|): R|kotlin/Unit| { ^setValue R|/IssueListView.IssueListView|().R|/IssueListView.updateFrom|(R|/value|) } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems.txt index 361754e2061..51823ab8ce4 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems.txt @@ -6,10 +6,10 @@ FILE: problems.kt super() } - public final val name: R|kotlin/String| = String(123) + public[local] final val name: R|kotlin/String| = String(123) public get(): R|kotlin/String| - public final fun test(): R|kotlin/Unit| { + public[local] final fun test(): R|kotlin/Unit| { this@R|/anonymous|.R|/anonymous.name| } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirStatusResolveTransformer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirStatusResolveTransformer.kt index 9bdfd35b327..576209bfafd 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirStatusResolveTransformer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirStatusResolveTransformer.kt @@ -54,7 +54,7 @@ private class FirStatusResolveTransformer(override val session: FirSession) : } private inline fun storeClass( - klass: FirRegularClass, + klass: FirClass<*>, computeResult: () -> CompositeTransformResult ): CompositeTransformResult { classes += klass @@ -77,6 +77,15 @@ private class FirStatusResolveTransformer(override val session: FirSession) : } as CompositeTransformResult } + override fun transformAnonymousObject( + anonymousObject: FirAnonymousObject, + data: FirDeclarationStatus? + ): CompositeTransformResult { + return storeClass(anonymousObject) { + transformElement(anonymousObject, data) + } as CompositeTransformResult + } + override fun transformPropertyAccessor( propertyAccessor: FirPropertyAccessor, data: FirDeclarationStatus? @@ -153,7 +162,11 @@ fun FirDeclaration.resolveStatus( ): FirDeclarationStatus { if (status.visibility == Visibilities.UNKNOWN || status.modality == null) { val visibility = when (status.visibility) { - Visibilities.UNKNOWN -> if (isLocal) Visibilities.LOCAL else resolveVisibility(containingClass) + Visibilities.UNKNOWN -> when { + isLocal -> Visibilities.LOCAL + this is FirConstructor && containingClass is FirAnonymousObject -> Visibilities.PRIVATE + else -> resolveVisibility(containingClass) + } else -> status.visibility } val modality = status.modality ?: resolveModality(containingClass) diff --git a/compiler/testData/diagnostics/tests/ObjectWithConstructor.fir.kt b/compiler/testData/diagnostics/tests/ObjectWithConstructor.fir.kt index 963a57289f6..9f7eaf5fbc0 100644 --- a/compiler/testData/diagnostics/tests/ObjectWithConstructor.fir.kt +++ b/compiler/testData/diagnostics/tests/ObjectWithConstructor.fir.kt @@ -11,7 +11,7 @@ object A2 public constructor(private val prop: Int) } val x = object (val prop: Int) { - constructor() : this(1) { + constructor() : this(1) { val x = 1 x * x } diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromOuterClassInObjectLiteral.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromOuterClassInObjectLiteral.fir.kt deleted file mode 100644 index 8a526465da1..00000000000 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromOuterClassInObjectLiteral.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -class A { - fun foo() { - val q = object { - open inner class B - inner class C : B() - - // No WRONG_NUMBER_OF_TYPE_ARGUMENTS should be reported on these types - val x: B = B() - val y: C = C() - } - - q.x - q.y - } -} diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromOuterClassInObjectLiteral.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromOuterClassInObjectLiteral.kt index 22600b275a6..470b1d33a08 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromOuterClassInObjectLiteral.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromOuterClassInObjectLiteral.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A { fun foo() { val q = object { diff --git a/compiler/testData/diagnostics/tests/subtyping/nestedIntoLocalClasses.fir.kt b/compiler/testData/diagnostics/tests/subtyping/nestedIntoLocalClasses.fir.kt index 105a61d60c1..bcd2f8e1689 100644 --- a/compiler/testData/diagnostics/tests/subtyping/nestedIntoLocalClasses.fir.kt +++ b/compiler/testData/diagnostics/tests/subtyping/nestedIntoLocalClasses.fir.kt @@ -6,14 +6,14 @@ package p private fun foo(a: Int) = run { object { inner class A - fun foo() = A() + fun foo() = A() }.foo() } private fun foo() = run { object { inner class A - fun foo() = A() + fun foo() = A() }.foo() }