From f71a56e7427fabcf630649958002679fdccc6d30 Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Thu, 7 May 2020 13:06:30 +0300 Subject: [PATCH] FIR: Fix test data after rewritten scope structure Mostly, the semantics for statics/companions has been changed there Fixed test data now is much closer to semantics of old FE --- .../tests/inner/innerThisSuper.fir.kt | 10 +- .../nestedVsInnerAccessOuterMember.fir.kt | 4 +- .../objects/kt21515/staticsFromJavaNew.fir.kt | 10 +- .../objects/kt21515/staticsFromJavaOld.fir.kt | 10 +- .../useDeprecatedConstructorNew.fir.kt | 100 ------------------ .../kt21515/useDeprecatedConstructorNew.kt | 1 + .../useDeprecatedConstructorOld.fir.kt | 14 +-- .../scopes/inheritance/companionObject.fir.kt | 4 +- .../companionObjectAfterJava.fir.kt | 4 +- .../scopes/inheritance/innerClasses.fir.kt | 4 +- .../nestedClassesFromInterface.fir.kt | 8 +- .../inheritance/nestedCompanionClass.fir.kt | 10 +- .../nestedCompanionClassVsNested.fir.kt | 8 +- .../nestedCompanionClassVsNestedJava.fir.kt | 4 +- .../scopes/inheritance/nestedFromJava.fir.kt | 8 +- .../nestedFromJavaAfterKotlin.fir.kt | 8 +- .../inheritance/nestedVsToplevelClass.fir.kt | 6 +- ...StaticMembersOfParentClassJKJ_after.fir.kt | 55 ---------- ...ssToStaticMembersOfParentClassJKJ_after.kt | 1 + ...taticMembersOfParentClassJKJ_before.fir.kt | 10 +- ...sToStaticMembersOfParentClass_after.fir.kt | 46 -------- ...ccessToStaticMembersOfParentClass_after.kt | 1 + ...ToStaticMembersOfParentClass_before.fir.kt | 10 +- .../inheritFromJavaAfterKotlin_after.fir.kt | 50 --------- .../inheritFromJavaAfterKotlin_after.kt | 1 + .../inheritFromJavaAfterKotlin_before.fir.kt | 6 +- .../inheritFromJava_after.fir.kt | 39 ------- .../companionObject/inheritFromJava_after.kt | 1 + .../inheritFromJava_before.fir.kt | 6 +- 29 files changed, 77 insertions(+), 362 deletions(-) delete mode 100644 compiler/testData/diagnostics/tests/objects/kt21515/useDeprecatedConstructorNew.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/accessToStaticMembersOfParentClassJKJ_after.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/accessToStaticMembersOfParentClass_after.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromJavaAfterKotlin_after.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromJava_after.fir.kt diff --git a/compiler/testData/diagnostics/tests/inner/innerThisSuper.fir.kt b/compiler/testData/diagnostics/tests/inner/innerThisSuper.fir.kt index e113a9abac0..a323ecc9ca1 100644 --- a/compiler/testData/diagnostics/tests/inner/innerThisSuper.fir.kt +++ b/compiler/testData/diagnostics/tests/inner/innerThisSuper.fir.kt @@ -6,12 +6,12 @@ interface Trait { class Outer : Trait { class Nested { - val t = this@Outer.bar() - val s = super@Outer.bar() + val t = this@Outer.bar() + val s = super@Outer.bar() inner class NestedInner { - val t = this@Outer.bar() - val s = super@Outer.bar() + val t = this@Outer.bar() + val s = super@Outer.bar() } } @@ -19,4 +19,4 @@ class Outer : Trait { val t = this@Outer.bar() val s = super@Outer.bar() } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/inner/nestedVsInnerAccessOuterMember.fir.kt b/compiler/testData/diagnostics/tests/inner/nestedVsInnerAccessOuterMember.fir.kt index e3806c9636d..7f1c074eb6d 100644 --- a/compiler/testData/diagnostics/tests/inner/nestedVsInnerAccessOuterMember.fir.kt +++ b/compiler/testData/diagnostics/tests/inner/nestedVsInnerAccessOuterMember.fir.kt @@ -7,8 +7,8 @@ class Outer { class Nested { fun f() = function() fun g() = property - fun h() = this@Outer.function() - fun i() = this@Outer.property + fun h() = this@Outer.function() + fun i() = this@Outer.property } inner class Inner { diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaNew.fir.kt b/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaNew.fir.kt index 503e8ef0da5..0f496a4ac54 100644 --- a/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaNew.fir.kt +++ b/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaNew.fir.kt @@ -28,10 +28,10 @@ open class Base { class Derived : Base() { fun test(javaStaticInTypePosition: Classifier) { - method() - property - Classifier() - syntheticSam { } + method() + property + Classifier() + syntheticSam { } // Instance members shouldn't be affected, but we check them, just in case val y = instanceSyntheticProperty @@ -45,4 +45,4 @@ class Derived : Base() { class JavaStaticInSupertypeList : Classifier() { } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaOld.fir.kt b/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaOld.fir.kt index d0fcffa0b87..3c16005da1b 100644 --- a/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaOld.fir.kt +++ b/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaOld.fir.kt @@ -28,10 +28,10 @@ open class Base { class Derived : Base() { fun test(javaStaticInTypePosition: Classifier) { - method() - property - Classifier() - syntheticSam { } + method() + property + Classifier() + syntheticSam { } // Instance members shouldn't be affected, but we check them, just in case val y = instanceSyntheticProperty @@ -45,4 +45,4 @@ class Derived : Base() { class JavaStaticInSupertypeList : Classifier() { } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/useDeprecatedConstructorNew.fir.kt b/compiler/testData/diagnostics/tests/objects/kt21515/useDeprecatedConstructorNew.fir.kt deleted file mode 100644 index b9552eb18a0..00000000000 --- a/compiler/testData/diagnostics/tests/objects/kt21515/useDeprecatedConstructorNew.fir.kt +++ /dev/null @@ -1,100 +0,0 @@ -// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion -// !DIAGNOSTICS: -UNUSED_VARIABLE - -// See KT-21515 for a class diagram and details - -// Object is to prevent accidental short-name import -object O { - open class Alpha { - class FromAlpha - - companion object { - class FromCompanionAlpha - } - } - - open class Beta : Alpha() { - class FromBeta - - companion object { - class FromCompanionBeta - } - } - - - open class A { - class FromA - - companion object : Beta() { - class FromCompanionA - } - } - -////////////////////////// - - open class FarAway { - class FromFarAway - - } - - open class Gamma { - class FromGamma - companion object : FarAway() { - class FromCompanionGamma - } - } - - open class B : A() { - class FromB - - companion object : Gamma() { - class FromCompanionB - } - } -} - -/////////////////////////////// - - -open class Delta { - class FromDelta -} - -class C : O.B() { - companion object : Delta() { - class FromCompanionC - } - - // VISIBLE: Classifiers from direct superclasses - val c = FromA() - val d = FromB() - - // VISIBLE: Classifiers from our own companion - val n = FromCompanionC() - - // INVISIBLE: direct superclasses themselves. - val a = A() - val b = B() - - // DEPRECATED: Classifiers from companions of direct superclasses - val e = FromCompanionA() - val f = FromCompanionB() - - // INVISIBLE: "cousin" supertypes themselves - val g = Alpha() - val h = Beta() - val i = Gamma() - - // DEPRECATED: classifiers from "cousin" superclasses - val k = FromAlpha() - val l = FromBeta() - val m = FromGamma() - - // INVISIBLE: We don't see classifiers from companions of "cousin" superclasses - val o = FromCompanionAlpha() - val p = FromCompanionBeta() - val q = FromCompanionGamma() - - // DEPRECATED: Classifiers from supertypes of our own companion - val r = FromDelta() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/useDeprecatedConstructorNew.kt b/compiler/testData/diagnostics/tests/objects/kt21515/useDeprecatedConstructorNew.kt index 62c8d5d5f0b..92c0c00a335 100644 --- a/compiler/testData/diagnostics/tests/objects/kt21515/useDeprecatedConstructorNew.kt +++ b/compiler/testData/diagnostics/tests/objects/kt21515/useDeprecatedConstructorNew.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion // !DIAGNOSTICS: -UNUSED_VARIABLE diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/useDeprecatedConstructorOld.fir.kt b/compiler/testData/diagnostics/tests/objects/kt21515/useDeprecatedConstructorOld.fir.kt index a3ad9f862f7..bf104e7f988 100644 --- a/compiler/testData/diagnostics/tests/objects/kt21515/useDeprecatedConstructorOld.fir.kt +++ b/compiler/testData/diagnostics/tests/objects/kt21515/useDeprecatedConstructorOld.fir.kt @@ -76,8 +76,8 @@ class C : O.B() { val b = B() // DEPRECATED: Classifiers from companions of direct superclasses - val e = FromCompanionA() - val f = FromCompanionB() + val e = FromCompanionA() + val f = FromCompanionB() // INVISIBLE: "cousin" supertypes themselves val g = Alpha() @@ -85,9 +85,9 @@ class C : O.B() { val i = Gamma() // DEPRECATED: classifiers from "cousin" superclasses - val k = FromAlpha() - val l = FromBeta() - val m = FromGamma() + val k = FromAlpha() + val l = FromBeta() + val m = FromGamma() // INVISIBLE: We don't see classifiers from companions of "cousin" superclasses val o = FromCompanionAlpha() @@ -95,5 +95,5 @@ class C : O.B() { val q = FromCompanionGamma() // DEPRECATED: Classifiers from supertypes of our own companion - val r = FromDelta() -} \ No newline at end of file + val r = FromDelta() +} diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/companionObject.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/companionObject.fir.kt index e6168faef1a..ea8817f6acc 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/companionObject.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/companionObject.fir.kt @@ -33,9 +33,9 @@ class C: B(), A { B.Companion.bar() C.bar() - B_() + B_() B.B_() B.Companion.B_() C.B_() } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/companionObjectAfterJava.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/companionObjectAfterJava.fir.kt index 1f0af8b342a..bf33833168b 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/companionObjectAfterJava.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/companionObjectAfterJava.fir.kt @@ -43,10 +43,10 @@ class D: C() { C.bar() D.bar() - B_() + B_() B.B_() B.Companion.B_() C.B_() D.B_() } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/innerClasses.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/innerClasses.fir.kt index 7db34448a12..11d03c45f7b 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/innerClasses.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/innerClasses.fir.kt @@ -30,7 +30,7 @@ class E: A() { B().bar() D() - C() + C() } object Z { @@ -39,7 +39,7 @@ class E: A() { B().bar() D() - C() + C() } } } diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/nestedClassesFromInterface.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/nestedClassesFromInterface.fir.kt index 04981874b40..86803e93c81 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/nestedClassesFromInterface.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/nestedClassesFromInterface.fir.kt @@ -9,19 +9,19 @@ interface B { } class X: A { - val a: A_ = A_() + val a: A_ = A_() val b: A.A_ = A.A_() companion object { - val a: A_ = A_() + val a: A_ = A_() } } class Y: B { - val a: B_ = B_() + val a: B_ = B_() val b: B.B_ = B.B_() companion object { - val b: B_ = B_() + val b: B_ = B_() } } diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/nestedCompanionClass.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/nestedCompanionClass.fir.kt index 6e079eb502a..022e9873218 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/nestedCompanionClass.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/nestedCompanionClass.fir.kt @@ -10,14 +10,14 @@ class C: A() { val b: B = null!! init { - B() + B() } object O { val b: B = null!! init { - B() + B() } } @@ -25,7 +25,7 @@ class C: A() { val b: B = null!! init { - B() + B() } } @@ -33,7 +33,7 @@ class C: A() { val b: B = null!! init { - B() + B() } } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/nestedCompanionClassVsNested.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/nestedCompanionClassVsNested.fir.kt index 7c2ade5d1f1..b350dcdcbdb 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/nestedCompanionClassVsNested.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/nestedCompanionClassVsNested.fir.kt @@ -28,7 +28,7 @@ open class A { class Simple: A() { init { Y().A_Y() - Z().A_C_Z() + Z().A_C_Z() } } @@ -86,10 +86,10 @@ class C: A() { } init { - Y().C_C_Y() - Y().A_Y() + Y().C_C_Y() + Y().A_Y() Z().C_C_Z() Z().A_C_Z() } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/nestedCompanionClassVsNestedJava.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/nestedCompanionClassVsNestedJava.fir.kt index d38e63e9ccb..410296adbb0 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/nestedCompanionClassVsNestedJava.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/nestedCompanionClassVsNestedJava.fir.kt @@ -42,6 +42,6 @@ class Y: C() { init { Y().A_Y() - Z().A_C_Z() + Z().A_C_Z() } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/nestedFromJava.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/nestedFromJava.fir.kt index 8ef1e10b68f..c7309cf95d4 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/nestedFromJava.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/nestedFromJava.fir.kt @@ -26,7 +26,7 @@ class X: A { val a_s: A_S = null!! init { - A_S() + A_S() A.A_S() X.A_S() } @@ -35,7 +35,7 @@ class X: A { val a_: A_S = null!! init { - A_S() + A_S() } } } @@ -71,7 +71,7 @@ class Z: C() { val b_s: B_S = null!! init { - A_S() + A_S() B_() B_S() } @@ -82,7 +82,7 @@ class Z: C() { val b_s: B_S = null!! init { - A_S() + A_S() B_() B_S() } diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/nestedFromJavaAfterKotlin.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/nestedFromJavaAfterKotlin.fir.kt index e4adf91374f..793f36adecb 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/nestedFromJavaAfterKotlin.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/nestedFromJavaAfterKotlin.fir.kt @@ -41,7 +41,7 @@ class X: D() { D.B_() X.B_() - A_S() + A_S() A.A_S() C.A_S() D.A_S() @@ -53,7 +53,7 @@ class X: D() { D.B_S() X.B_S() - E_S() + E_S() E.E_S() D.E_S() X.E_S() @@ -67,7 +67,7 @@ class Y: F() { F.B_() Y.B_() - A_S() + A_S() F.A_S() Y.A_S() @@ -75,7 +75,7 @@ class Y: F() { F.B_S() Y.B_S() - E_S() + E_S() F.E_S() Y.E_S() } diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/nestedVsToplevelClass.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/nestedVsToplevelClass.fir.kt index 6da4e2102e3..0b16bda987e 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/nestedVsToplevelClass.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/nestedVsToplevelClass.fir.kt @@ -32,7 +32,7 @@ class B: A() { X().A_X() X().T_X() - Y().A_C_Y() - Y().T_Y() + Y().A_C_Y() + Y().T_Y() } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/accessToStaticMembersOfParentClassJKJ_after.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/accessToStaticMembersOfParentClassJKJ_after.fir.kt deleted file mode 100644 index 591be05f5e9..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/accessToStaticMembersOfParentClassJKJ_after.fir.kt +++ /dev/null @@ -1,55 +0,0 @@ -// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion -// FILE: J.java -public class J { - public static void foo() {} -} - -// FILE: J2.java -public class J2 extends A { - public static void boo() {} -} - -// FILE: test.kt -open class A { - companion object : J() { - fun bar() {} - } -} - -class B : J2() { - init { - foo() - bar() - boo() - } - - fun test2() { - foo() - bar() - boo() - } - - object O { - fun test() { - foo() - bar() - boo() - } - } - - companion object { - init { - foo() - bar() - boo() - } - - fun test() { - foo() - bar() - boo() - } - - fun bar() {} - } -} diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/accessToStaticMembersOfParentClassJKJ_after.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/accessToStaticMembersOfParentClassJKJ_after.kt index 4f1de885bcf..1294736d778 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/accessToStaticMembersOfParentClassJKJ_after.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/accessToStaticMembersOfParentClassJKJ_after.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion // FILE: J.java public class J { diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/accessToStaticMembersOfParentClassJKJ_before.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/accessToStaticMembersOfParentClassJKJ_before.fir.kt index 3e2488e6972..8064c385460 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/accessToStaticMembersOfParentClassJKJ_before.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/accessToStaticMembersOfParentClassJKJ_before.fir.kt @@ -18,20 +18,20 @@ open class A { class B : J2() { init { - foo() + foo() bar() boo() } fun test2() { - foo() + foo() bar() boo() } object O { fun test() { - foo() + foo() bar() boo() } @@ -39,13 +39,13 @@ class B : J2() { companion object { init { - foo() + foo() bar() boo() } fun test() { - foo() + foo() bar() boo() } diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/accessToStaticMembersOfParentClass_after.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/accessToStaticMembersOfParentClass_after.fir.kt deleted file mode 100644 index 4718feab9d3..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/accessToStaticMembersOfParentClass_after.fir.kt +++ /dev/null @@ -1,46 +0,0 @@ -// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion -// FILE: J.java -public class J { - public static void foo() {} -} - -// FILE: test.kt -open class A { - companion object : J() { - fun bar() {} - } -} - -class B : A() { - init { - foo() - bar() - } - - fun test2() { - foo() - bar() - } - - object O { - fun test() { - foo() - bar() - } - } - - companion object { - init { - foo() - bar() - } - - fun test() { - foo() - bar() - } - - fun bar() {} - } -} - diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/accessToStaticMembersOfParentClass_after.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/accessToStaticMembersOfParentClass_after.kt index aa556c2c09a..bb3107c73b3 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/accessToStaticMembersOfParentClass_after.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/accessToStaticMembersOfParentClass_after.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion // FILE: J.java public class J { diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/accessToStaticMembersOfParentClass_before.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/accessToStaticMembersOfParentClass_before.fir.kt index 5098fb3449a..28daf2d8470 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/accessToStaticMembersOfParentClass_before.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/accessToStaticMembersOfParentClass_before.fir.kt @@ -13,30 +13,30 @@ open class A { class B : A() { init { - foo() + foo() bar() } fun test2() { - foo() + foo() bar() } object O { fun test() { - foo() + foo() bar() } } companion object { init { - foo() + foo() bar() } fun test() { - foo() + foo() bar() } diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromJavaAfterKotlin_after.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromJavaAfterKotlin_after.fir.kt deleted file mode 100644 index 29a0dc60b2c..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromJavaAfterKotlin_after.fir.kt +++ /dev/null @@ -1,50 +0,0 @@ -// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion -// FILE: J.java -public class J { - public static void foo() {} -} - -// FILE: test.kt - -open class B : J() { - fun baz() {} -} - -class A { - init { - foo() - bar() - baz() - } - - fun test1() { - foo() - bar() - baz() - } - - object O { - fun test() { - foo() - bar() - baz() - } - } - - - companion object : B() { - init { - foo() - bar() - baz() - } - - fun test() { - foo() - bar() - baz() - } - - fun bar() {} - } -} diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromJavaAfterKotlin_after.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromJavaAfterKotlin_after.kt index 77ea21a9bbf..6abd67de807 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromJavaAfterKotlin_after.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromJavaAfterKotlin_after.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion // FILE: J.java public class J { diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromJavaAfterKotlin_before.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromJavaAfterKotlin_before.fir.kt index f50853f8270..349331eb919 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromJavaAfterKotlin_before.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromJavaAfterKotlin_before.fir.kt @@ -12,20 +12,20 @@ open class B : J() { class A { init { - foo() + foo() bar() baz() } fun test1() { - foo() + foo() bar() baz() } object O { fun test() { - foo() + foo() bar() baz() } diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromJava_after.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromJava_after.fir.kt deleted file mode 100644 index cebcc3677e5..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromJava_after.fir.kt +++ /dev/null @@ -1,39 +0,0 @@ -// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion -// FILE: J.java -public class J { - public static void foo() {} -} - -// FILE: test.kt -class A { - init { - foo() - bar() - } - - fun test1() { - foo() - bar() - } - - object O { - fun test() { - foo() - bar() - } - } - - companion object : J() { - init { - foo() - bar() - } - - fun test() { - foo() - bar() - } - - fun bar() {} - } -} diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromJava_after.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromJava_after.kt index 2abf7f10610..68f182813d3 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromJava_after.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromJava_after.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion // FILE: J.java public class J { diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromJava_before.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromJava_before.fir.kt index 63a5a2660e8..2e585f6aa21 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromJava_before.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromJava_before.fir.kt @@ -7,18 +7,18 @@ public class J { // FILE: test.kt class A { init { - foo() + foo() bar() } fun test1() { - foo() + foo() bar() } object O { fun test() { - foo() + foo() bar() } }