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
This commit is contained in:
+5
-5
@@ -28,10 +28,10 @@ open class Base {
|
||||
|
||||
class Derived : Base() {
|
||||
fun test(javaStaticInTypePosition: Classifier) {
|
||||
method()
|
||||
property
|
||||
Classifier()
|
||||
syntheticSam { }
|
||||
<!UNRESOLVED_REFERENCE!>method<!>()
|
||||
<!UNRESOLVED_REFERENCE!>property<!>
|
||||
<!UNRESOLVED_REFERENCE!>Classifier<!>()
|
||||
<!UNRESOLVED_REFERENCE!>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() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -28,10 +28,10 @@ open class Base {
|
||||
|
||||
class Derived : Base() {
|
||||
fun test(javaStaticInTypePosition: Classifier) {
|
||||
method()
|
||||
property
|
||||
Classifier()
|
||||
syntheticSam { }
|
||||
<!UNRESOLVED_REFERENCE!>method<!>()
|
||||
<!UNRESOLVED_REFERENCE!>property<!>
|
||||
<!UNRESOLVED_REFERENCE!>Classifier<!>()
|
||||
<!UNRESOLVED_REFERENCE!>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() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-100
@@ -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 = <!UNRESOLVED_REFERENCE!>A<!>()
|
||||
val b = <!UNRESOLVED_REFERENCE!>B<!>()
|
||||
|
||||
// DEPRECATED: Classifiers from companions of direct superclasses
|
||||
val e = FromCompanionA()
|
||||
val f = FromCompanionB()
|
||||
|
||||
// INVISIBLE: "cousin" supertypes themselves
|
||||
val g = <!UNRESOLVED_REFERENCE!>Alpha<!>()
|
||||
val h = <!UNRESOLVED_REFERENCE!>Beta<!>()
|
||||
val i = <!UNRESOLVED_REFERENCE!>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 = <!UNRESOLVED_REFERENCE!>FromCompanionAlpha<!>()
|
||||
val p = <!UNRESOLVED_REFERENCE!>FromCompanionBeta<!>()
|
||||
val q = <!UNRESOLVED_REFERENCE!>FromCompanionGamma<!>()
|
||||
|
||||
// DEPRECATED: Classifiers from supertypes of our own companion
|
||||
val r = FromDelta()
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
|
||||
|
||||
+7
-7
@@ -76,8 +76,8 @@ class C : O.B() {
|
||||
val b = <!UNRESOLVED_REFERENCE!>B<!>()
|
||||
|
||||
// DEPRECATED: Classifiers from companions of direct superclasses
|
||||
val e = FromCompanionA()
|
||||
val f = FromCompanionB()
|
||||
val e = <!UNRESOLVED_REFERENCE!>FromCompanionA<!>()
|
||||
val f = <!UNRESOLVED_REFERENCE!>FromCompanionB<!>()
|
||||
|
||||
// INVISIBLE: "cousin" supertypes themselves
|
||||
val g = <!UNRESOLVED_REFERENCE!>Alpha<!>()
|
||||
@@ -85,9 +85,9 @@ class C : O.B() {
|
||||
val i = <!UNRESOLVED_REFERENCE!>Gamma<!>()
|
||||
|
||||
// DEPRECATED: classifiers from "cousin" superclasses
|
||||
val k = FromAlpha()
|
||||
val l = FromBeta()
|
||||
val m = FromGamma()
|
||||
val k = <!UNRESOLVED_REFERENCE!>FromAlpha<!>()
|
||||
val l = <!UNRESOLVED_REFERENCE!>FromBeta<!>()
|
||||
val m = <!UNRESOLVED_REFERENCE!>FromGamma<!>()
|
||||
|
||||
// INVISIBLE: We don't see classifiers from companions of "cousin" superclasses
|
||||
val o = <!UNRESOLVED_REFERENCE!>FromCompanionAlpha<!>()
|
||||
@@ -95,5 +95,5 @@ class C : O.B() {
|
||||
val q = <!UNRESOLVED_REFERENCE!>FromCompanionGamma<!>()
|
||||
|
||||
// DEPRECATED: Classifiers from supertypes of our own companion
|
||||
val r = FromDelta()
|
||||
}
|
||||
val r = <!UNRESOLVED_REFERENCE!>FromDelta<!>()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user