Introduce FIR_IDENTICAL for FIR vs old frontend tests #KT-36879 Fixed
This commit is contained in:
Vendored
-142
@@ -1,142 +0,0 @@
|
||||
// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
|
||||
// See KT-21515 for a class diagram and details
|
||||
|
||||
// class is to prevent accidental short-name import
|
||||
class O {
|
||||
open class Alpha {
|
||||
open fun foo() = 42
|
||||
|
||||
class FromAlpha {
|
||||
fun foo() = 42
|
||||
}
|
||||
|
||||
companion object {
|
||||
class FromCompanionAlpha {
|
||||
fun foo() = 42
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
open class Beta : Alpha() {
|
||||
override fun foo() = 42
|
||||
|
||||
class FromBeta {
|
||||
fun foo() = 42
|
||||
}
|
||||
|
||||
companion object {
|
||||
class FromCompanionBeta {
|
||||
fun foo() = 42
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
open class A {
|
||||
open fun foo() = 42
|
||||
|
||||
class FromA {
|
||||
fun foo() = 42
|
||||
}
|
||||
|
||||
companion object : Beta() {
|
||||
class FromCompanionA {
|
||||
fun foo() = 42
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
|
||||
open class FarAway {
|
||||
open fun foo() = 42
|
||||
|
||||
class FromFarAway {
|
||||
fun foo() = 42
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
open class Gamma {
|
||||
open fun foo() = 42
|
||||
|
||||
class FromGamma {
|
||||
fun foo() = 42
|
||||
}
|
||||
|
||||
companion object : FarAway() {
|
||||
class FromCompanionGamma {
|
||||
fun foo() = 42
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
open class B : A() {
|
||||
override fun foo() = 42
|
||||
|
||||
class FromB {
|
||||
fun foo() = 42
|
||||
}
|
||||
|
||||
companion object : Gamma() {
|
||||
override fun foo() = 42
|
||||
|
||||
class FromCompanionB {
|
||||
fun foo() = 42
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////
|
||||
|
||||
|
||||
open class Delta {
|
||||
open fun foo() = 42
|
||||
class FromDelta {
|
||||
fun foo() = 42
|
||||
}
|
||||
}
|
||||
|
||||
class C : O.B() {
|
||||
override fun foo() = 42
|
||||
|
||||
companion object : Delta() {
|
||||
class FromCompanionC {
|
||||
fun foo() = 42
|
||||
}
|
||||
}
|
||||
|
||||
// VISIBLE: Classifiers from direct superclasses
|
||||
val c = O.A.FromA::foo
|
||||
val d = O.B.FromB::foo
|
||||
|
||||
// VISIBLE: Classifiers from our own companion
|
||||
val n = C.Companion.FromCompanionC::foo
|
||||
|
||||
// INVISIBLE: direct superclasses themselves.
|
||||
val a = O.A::foo
|
||||
val b = O.A::foo
|
||||
|
||||
// DEPRECATED: Classifiers from companions of direct superclasses
|
||||
val e = O.A.Companion.FromCompanionA::foo
|
||||
val f = O.B.Companion.FromCompanionB::foo
|
||||
|
||||
// INVISIBLE: "cousin" supertypes themselves
|
||||
val g = O.Alpha::foo
|
||||
val h = O.Beta::foo
|
||||
val i = O.Gamma::foo
|
||||
|
||||
// DEPRECATED: classifiers from "cousin" superclasses
|
||||
val k = O.Alpha.FromAlpha::foo
|
||||
val l = O.Beta.FromBeta::foo
|
||||
val m = O.Gamma.FromGamma::foo
|
||||
|
||||
// INVISIBLE: We don't see classifiers from companions of "cousin" superclasses
|
||||
val o = O.Alpha.Companion.FromCompanionAlpha::foo
|
||||
val p = O.Beta.Companion.FromCompanionBeta::foo
|
||||
val q = O.Gamma.Companion.FromCompanionGamma::foo
|
||||
|
||||
// DEPRECATED: Classifiers from supertypes of our own companion
|
||||
val r = Delta.FromDelta::foo
|
||||
}
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
|
||||
// See KT-21515 for a class diagram and details
|
||||
|
||||
|
||||
Vendored
-142
@@ -1,142 +0,0 @@
|
||||
// !LANGUAGE: -ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
|
||||
// See KT-21515 for a class diagram and details
|
||||
|
||||
// class is to prevent accidental short-name import
|
||||
class O {
|
||||
open class Alpha {
|
||||
open fun foo() = 42
|
||||
|
||||
class FromAlpha {
|
||||
fun foo() = 42
|
||||
}
|
||||
|
||||
companion object {
|
||||
class FromCompanionAlpha {
|
||||
fun foo() = 42
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
open class Beta : Alpha() {
|
||||
override fun foo() = 42
|
||||
|
||||
class FromBeta {
|
||||
fun foo() = 42
|
||||
}
|
||||
|
||||
companion object {
|
||||
class FromCompanionBeta {
|
||||
fun foo() = 42
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
open class A {
|
||||
open fun foo() = 42
|
||||
|
||||
class FromA {
|
||||
fun foo() = 42
|
||||
}
|
||||
|
||||
companion object : Beta() {
|
||||
class FromCompanionA {
|
||||
fun foo() = 42
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
|
||||
open class FarAway {
|
||||
open fun foo() = 42
|
||||
|
||||
class FromFarAway {
|
||||
fun foo() = 42
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
open class Gamma {
|
||||
open fun foo() = 42
|
||||
|
||||
class FromGamma {
|
||||
fun foo() = 42
|
||||
}
|
||||
|
||||
companion object : FarAway() {
|
||||
class FromCompanionGamma {
|
||||
fun foo() = 42
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
open class B : A() {
|
||||
override fun foo() = 42
|
||||
|
||||
class FromB {
|
||||
fun foo() = 42
|
||||
}
|
||||
|
||||
companion object : Gamma() {
|
||||
override fun foo() = 42
|
||||
|
||||
class FromCompanionB {
|
||||
fun foo() = 42
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////
|
||||
|
||||
|
||||
open class Delta {
|
||||
open fun foo() = 42
|
||||
class FromDelta {
|
||||
fun foo() = 42
|
||||
}
|
||||
}
|
||||
|
||||
class C : O.B() {
|
||||
override fun foo() = 42
|
||||
|
||||
companion object : Delta() {
|
||||
class FromCompanionC {
|
||||
fun foo() = 42
|
||||
}
|
||||
}
|
||||
|
||||
// VISIBLE: Classifiers from direct superclasses
|
||||
val c = O.A.FromA::foo
|
||||
val d = O.B.FromB::foo
|
||||
|
||||
// VISIBLE: Classifiers from our own companion
|
||||
val n = FromCompanionC::foo
|
||||
|
||||
// INVISIBLE: direct superclasses themselves.
|
||||
val a = O.A::foo
|
||||
val b = O.A::foo
|
||||
|
||||
// DEPRECATED: Classifiers from companions of direct superclasses
|
||||
val e = O.A.Companion.FromCompanionA::foo
|
||||
val f = O.B.Companion.FromCompanionB::foo
|
||||
|
||||
// INVISIBLE: "cousin" supertypes themselves
|
||||
val g = O.Alpha::foo
|
||||
val h = O.Beta::foo
|
||||
val i = O.Gamma::foo
|
||||
|
||||
// DEPRECATED: classifiers from "cousin" superclasses
|
||||
val k = O.Alpha.FromAlpha::foo
|
||||
val l = O.Beta.FromBeta::foo
|
||||
val m = O.Gamma.FromGamma::foo
|
||||
|
||||
// INVISIBLE: We don't see classifiers from companions of "cousin" superclasses
|
||||
val o = O.Alpha.Companion.FromCompanionAlpha::foo
|
||||
val p = O.Beta.Companion.FromCompanionBeta::foo
|
||||
val q = O.Gamma.Companion.FromCompanionGamma::foo
|
||||
|
||||
// DEPRECATED: Classifiers from supertypes of our own companion
|
||||
val r = Delta.FromDelta::foo
|
||||
}
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: -ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
|
||||
// See KT-21515 for a class diagram and details
|
||||
|
||||
|
||||
-99
@@ -1,99 +0,0 @@
|
||||
// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
|
||||
|
||||
// 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: O.A.FromA? = null
|
||||
val d: O.B.FromB? = null
|
||||
|
||||
// VISIBLE: Classifiers from our own companion
|
||||
val n: C.Companion.FromCompanionC? = null
|
||||
|
||||
// INVISIBLE: direct superclasses themselves.
|
||||
val a: O.A? = null
|
||||
val b: O.B? = null
|
||||
|
||||
// DEPRECATED: Classifiers from companions of direct superclasses
|
||||
val e: O.A.Companion.FromCompanionA? = null
|
||||
val f: O.B.Companion.FromCompanionB? = null
|
||||
|
||||
// INVISIBLE: "cousin" supertypes themselves
|
||||
val g: O.Alpha? = null
|
||||
val h: O.Beta? = null
|
||||
val i: O.Gamma? = null
|
||||
|
||||
// DEPRECATED: classifiers from "cousin" superclasses
|
||||
val k: O.Alpha.FromAlpha? = null
|
||||
val l: O.Beta.FromBeta? = null
|
||||
val m: O.Gamma.FromGamma? = null
|
||||
|
||||
// INVISIBLE: We don't see classifiers from companions of "cousin" superclasses
|
||||
val o: O.Alpha.Companion.FromCompanionAlpha? = null
|
||||
val p: O.Beta.Companion.FromCompanionBeta? = null
|
||||
val q: O.Gamma.Companion.FromCompanionGamma? = null
|
||||
|
||||
// DEPRECATED: Classifiers from supertypes of our own companion
|
||||
val r: Delta.FromDelta? = null
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
|
||||
|
||||
// See KT-21515 for a class diagram and details
|
||||
|
||||
-98
@@ -1,98 +0,0 @@
|
||||
// !LANGUAGE: -ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
|
||||
// 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: O.A.FromA? = null
|
||||
val d: O.B.FromB? = null
|
||||
|
||||
// VISIBLE: Classifiers from our own companion
|
||||
val n: C.Companion.FromCompanionC? = null
|
||||
|
||||
// INVISIBLE: direct superclasses themselves.
|
||||
val a: O.A? = null
|
||||
val b: O.B? = null
|
||||
|
||||
// DEPRECATED: Classifiers from companions of direct superclasses
|
||||
val e: O.A.Companion.FromCompanionA? = null
|
||||
val f: O.B.Companion.FromCompanionB? = null
|
||||
|
||||
// INVISIBLE: "cousin" supertypes themselves
|
||||
val g: O.Alpha? = null
|
||||
val h: O.Beta? = null
|
||||
val i: O.Gamma? = null
|
||||
|
||||
// DEPRECATED: classifiers from "cousin" superclasses
|
||||
val k: O.Alpha.FromAlpha? = null
|
||||
val l: O.Beta.FromBeta? = null
|
||||
val m: O.Gamma.FromGamma? = null
|
||||
|
||||
// INVISIBLE: We don't see classifiers from companions of "cousin" superclasses
|
||||
val o: O.Alpha.Companion.FromCompanionAlpha? = null
|
||||
val p: O.Beta.Companion.FromCompanionBeta? = null
|
||||
val q: O.Gamma.Companion.FromCompanionGamma? = null
|
||||
|
||||
// DEPRECATED: Classifiers from supertypes of our own companion
|
||||
val r: Delta.FromDelta? = null
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: -ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
|
||||
// See KT-21515 for a class diagram and details
|
||||
|
||||
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
open class A {
|
||||
class FromA {
|
||||
fun foo() = 42
|
||||
}
|
||||
}
|
||||
|
||||
class B : A() {
|
||||
companion object : A() { }
|
||||
|
||||
// we're seeing FromA here by two paths: one is deprecated (via companion object), and another one is not,
|
||||
// so we shouldn't see deprecation warning
|
||||
val a: FromA? = null
|
||||
|
||||
val b = FromA::foo
|
||||
|
||||
val c = FromA()
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
open class A {
|
||||
class FromA {
|
||||
fun foo() = 42
|
||||
|
||||
-100
@@ -1,100 +0,0 @@
|
||||
// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
|
||||
// See KT-21515 for a open class diagram and details
|
||||
|
||||
// Object is to prevent accidental short-name import
|
||||
object O {
|
||||
open class Alpha {
|
||||
open class FromAlpha
|
||||
|
||||
companion object {
|
||||
open class FromCompanionAlpha
|
||||
}
|
||||
}
|
||||
|
||||
open class Beta : Alpha() {
|
||||
open class FromBeta
|
||||
|
||||
companion object {
|
||||
open class FromCompanionBeta
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
open class A {
|
||||
open class FromA
|
||||
|
||||
companion object : Beta() {
|
||||
open class FromCompanionA
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
|
||||
open class FarAway {
|
||||
open class FromFarAway
|
||||
|
||||
}
|
||||
|
||||
open class Gamma {
|
||||
open class FromGamma
|
||||
companion object : FarAway() {
|
||||
open class FromCompanionGamma
|
||||
}
|
||||
}
|
||||
|
||||
open class B : A() {
|
||||
open class FromB
|
||||
|
||||
companion object : Gamma() {
|
||||
open class FromCompanionB
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////
|
||||
|
||||
|
||||
open class Delta {
|
||||
open class FromDelta
|
||||
}
|
||||
|
||||
open class C : O.B() {
|
||||
companion object : Delta() {
|
||||
open class FromCompanionC
|
||||
}
|
||||
|
||||
// VISIBLE: Classifiers from direct superclasses
|
||||
open class c : O.A.FromA()
|
||||
open class d : O.B.FromB()
|
||||
|
||||
// VISIBLE: Classifiers from our own companion
|
||||
open class n : C.Companion.FromCompanionC()
|
||||
|
||||
// INVISIBLE: direct superclasses themselves.
|
||||
open class a : O.A()
|
||||
open class b : O.B()
|
||||
|
||||
// DEPRECATED: Classifiers from companions of direct superclasses
|
||||
open class e : O.A.Companion.FromCompanionA()
|
||||
open class f : O.B.Companion.FromCompanionB()
|
||||
|
||||
// INVISIBLE: "cousin" supertypes themselves
|
||||
open class g : O.Alpha()
|
||||
open class h : O.Beta()
|
||||
open class i : O.Gamma()
|
||||
|
||||
// DEPRECATED: classifiers from "cousin" superclasses
|
||||
open class k : O.Alpha.FromAlpha()
|
||||
open class l : O.Beta.FromBeta()
|
||||
open class m : O.Gamma.FromGamma()
|
||||
|
||||
// INVISIBLE: We don't see classifiers from companions of "cousin" superclasses
|
||||
open class o : O.Alpha.Companion.FromCompanionAlpha()
|
||||
open class p : O.Beta.Companion.FromCompanionBeta()
|
||||
open class q : O.Gamma.Companion.FromCompanionGamma()
|
||||
|
||||
// DEPRECATED: Classifiers from supertypes of our own companion
|
||||
open class r : Delta.FromDelta()
|
||||
}
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
|
||||
|
||||
-100
@@ -1,100 +0,0 @@
|
||||
// !LANGUAGE: -ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
|
||||
// See KT-21515 for a open class diagram and details
|
||||
|
||||
// Object is to prevent accidental short-name import
|
||||
object O {
|
||||
open class Alpha {
|
||||
open class FromAlpha
|
||||
|
||||
companion object {
|
||||
open class FromCompanionAlpha
|
||||
}
|
||||
}
|
||||
|
||||
open class Beta : Alpha() {
|
||||
open class FromBeta
|
||||
|
||||
companion object {
|
||||
open class FromCompanionBeta
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
open class A {
|
||||
open class FromA
|
||||
|
||||
companion object : Beta() {
|
||||
open class FromCompanionA
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
|
||||
open class FarAway {
|
||||
open class FromFarAway
|
||||
|
||||
}
|
||||
|
||||
open class Gamma {
|
||||
open class FromGamma
|
||||
companion object : FarAway() {
|
||||
open class FromCompanionGamma
|
||||
}
|
||||
}
|
||||
|
||||
open class B : A() {
|
||||
open class FromB
|
||||
|
||||
companion object : Gamma() {
|
||||
open class FromCompanionB
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////
|
||||
|
||||
|
||||
open class Delta {
|
||||
open class FromDelta
|
||||
}
|
||||
|
||||
open class C : O.B() {
|
||||
companion object : Delta() {
|
||||
open class FromCompanionC
|
||||
}
|
||||
|
||||
// VISIBLE: Classifiers from direct superclasses
|
||||
open class c : O.A.FromA()
|
||||
open class d : O.B.FromB()
|
||||
|
||||
// VISIBLE: Classifiers from our own companion
|
||||
open class n : C.Companion.FromCompanionC()
|
||||
|
||||
// INVISIBLE: direct superclasses themselves.
|
||||
open class a : O.A()
|
||||
open class b : O.B()
|
||||
|
||||
// DEPRECATED: Classifiers from companions of direct superclasses
|
||||
open class e : O.A.Companion.FromCompanionA()
|
||||
open class f : O.B.Companion.FromCompanionB()
|
||||
|
||||
// INVISIBLE: "cousin" supertypes themselves
|
||||
open class g : O.Alpha()
|
||||
open class h : O.Beta()
|
||||
open class i : O.Gamma()
|
||||
|
||||
// DEPRECATED: classifiers from "cousin" superclasses
|
||||
open class k : O.Alpha.FromAlpha()
|
||||
open class l : O.Beta.FromBeta()
|
||||
open class m : O.Gamma.FromGamma()
|
||||
|
||||
// INVISIBLE: We don't see classifiers from companions of "cousin" superclasses
|
||||
open class o : O.Alpha.Companion.FromCompanionAlpha()
|
||||
open class p : O.Beta.Companion.FromCompanionBeta()
|
||||
open class q : O.Gamma.Companion.FromCompanionGamma()
|
||||
|
||||
// DEPRECATED: Classifiers from supertypes of our own companion
|
||||
open class r : Delta.FromDelta()
|
||||
}
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: -ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
|
||||
|
||||
Vendored
-53
@@ -1,53 +0,0 @@
|
||||
// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
|
||||
|
||||
// FILE: test/Java.java
|
||||
package test;
|
||||
|
||||
public class Java {
|
||||
public static void method() { }
|
||||
public static int property = 42;
|
||||
public static class Classifier { }
|
||||
public static void syntheticSam(Runnable r) { }
|
||||
|
||||
public static int getStaticSyntheticProperty() { return 42; }
|
||||
public static int setStaticSyntheticProperty(int x) { return 42; }
|
||||
|
||||
public int getInstanceSyntheticProperty() { return 42; }
|
||||
public int setInstanceSyntheticProperty(int x) { return 42; }
|
||||
}
|
||||
|
||||
// FILE: Kotlin.kt
|
||||
package test
|
||||
|
||||
import test.Java.method
|
||||
import test.Java.Classifier
|
||||
import test.Java.property
|
||||
import test.Java.syntheticSam
|
||||
|
||||
open class Base {
|
||||
companion object : Java() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class Derived : Base() {
|
||||
fun test(javaStaticInTypePosition: Classifier) {
|
||||
method()
|
||||
property
|
||||
Classifier()
|
||||
syntheticSam { }
|
||||
|
||||
// Instance members shouldn't be affected, but we check them, just in case
|
||||
val y = instanceSyntheticProperty
|
||||
instanceSyntheticProperty = 43
|
||||
|
||||
// Note that statics actually aren't converted into synthetic property in Kotlin
|
||||
val x = <!UNRESOLVED_REFERENCE!>syntheticProperty<!>
|
||||
<!UNRESOLVED_REFERENCE!>syntheticProperty<!> = 42
|
||||
}
|
||||
|
||||
class JavaStaticInSupertypeList : Classifier() {
|
||||
|
||||
}
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
|
||||
|
||||
|
||||
Vendored
-53
@@ -1,53 +0,0 @@
|
||||
// !LANGUAGE: -ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
|
||||
|
||||
// FILE: test/Java.java
|
||||
package test;
|
||||
|
||||
public class Java {
|
||||
public static void method() { }
|
||||
public static int property = 42;
|
||||
public static class Classifier { }
|
||||
public static void syntheticSam(Runnable r) { }
|
||||
|
||||
public static int getStaticSyntheticProperty() { return 42; }
|
||||
public static int setStaticSyntheticProperty(int x) { return 42; }
|
||||
|
||||
public int getInstanceSyntheticProperty() { return 42; }
|
||||
public int setInstanceSyntheticProperty(int x) { return 42; }
|
||||
}
|
||||
|
||||
// FILE: Kotlin.kt
|
||||
package test
|
||||
|
||||
import test.Java.method
|
||||
import test.Java.Classifier
|
||||
import test.Java.property
|
||||
import test.Java.syntheticSam
|
||||
|
||||
open class Base {
|
||||
companion object : Java() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class Derived : Base() {
|
||||
fun test(javaStaticInTypePosition: Classifier) {
|
||||
method()
|
||||
property
|
||||
Classifier()
|
||||
syntheticSam { }
|
||||
|
||||
// Instance members shouldn't be affected, but we check them, just in case
|
||||
val y = instanceSyntheticProperty
|
||||
instanceSyntheticProperty = 43
|
||||
|
||||
// Note that statics actually aren't converted into synthetic property in Kotlin
|
||||
val x = <!UNRESOLVED_REFERENCE!>syntheticProperty<!>
|
||||
<!UNRESOLVED_REFERENCE!>syntheticProperty<!> = 42
|
||||
}
|
||||
|
||||
class JavaStaticInSupertypeList : Classifier() {
|
||||
|
||||
}
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: -ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
|
||||
|
||||
|
||||
-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 = O.A.FromA()
|
||||
val d = O.B.FromB()
|
||||
|
||||
// VISIBLE: Classifiers from our own companion
|
||||
val n = C.Companion.FromCompanionC()
|
||||
|
||||
// INVISIBLE: direct superclasses themselves.
|
||||
val a = O.A()
|
||||
val b = O.B()
|
||||
|
||||
// DEPRECATED: Classifiers from companions of direct superclasses
|
||||
val e = O.A.Companion.FromCompanionA()
|
||||
val f = O.B.Companion.FromCompanionB()
|
||||
|
||||
// INVISIBLE: "cousin" supertypes themselves
|
||||
val g = O.Alpha()
|
||||
val h = O.Beta()
|
||||
val i = O.Gamma()
|
||||
|
||||
// DEPRECATED: classifiers from "cousin" superclasses
|
||||
val k = O.Alpha.FromAlpha()
|
||||
val l = O.Beta.FromBeta()
|
||||
val m = O.Gamma.FromGamma()
|
||||
|
||||
// INVISIBLE: We don't see classifiers from companions of "cousin" superclasses
|
||||
val o = O.Alpha.Companion.FromCompanionAlpha()
|
||||
val p = O.Beta.Companion.FromCompanionBeta()
|
||||
val q = O.Gamma.Companion.FromCompanionGamma()
|
||||
|
||||
// DEPRECATED: Classifiers from supertypes of our own companion
|
||||
val r = Delta.FromDelta()
|
||||
}
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
|
||||
|
||||
-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 = O.A.FromA()
|
||||
val d = O.B.FromB()
|
||||
|
||||
// VISIBLE: Classifiers from our own companion
|
||||
val n = C.Companion.FromCompanionC()
|
||||
|
||||
// INVISIBLE: direct superclasses themselves.
|
||||
val a = O.A()
|
||||
val b = O.B()
|
||||
|
||||
// DEPRECATED: Classifiers from companions of direct superclasses
|
||||
val e = O.A.Companion.FromCompanionA()
|
||||
val f = O.B.Companion.FromCompanionB()
|
||||
|
||||
// INVISIBLE: "cousin" supertypes themselves
|
||||
val g = O.Alpha()
|
||||
val h = O.Beta()
|
||||
val i = O.Gamma()
|
||||
|
||||
// DEPRECATED: classifiers from "cousin" superclasses
|
||||
val k = O.Alpha.FromAlpha()
|
||||
val l = O.Beta.FromBeta()
|
||||
val m = O.Gamma.FromGamma()
|
||||
|
||||
// INVISIBLE: We don't see classifiers from companions of "cousin" superclasses
|
||||
val o = O.Alpha.Companion.FromCompanionAlpha()
|
||||
val p = O.Beta.Companion.FromCompanionBeta()
|
||||
val q = O.Gamma.Companion.FromCompanionGamma()
|
||||
|
||||
// DEPRECATED: Classifiers from supertypes of our own companion
|
||||
val r = Delta.FromDelta()
|
||||
}
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: -ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
fun foo() {
|
||||
val a = object {
|
||||
val b = object {
|
||||
val c = 42
|
||||
}
|
||||
}
|
||||
|
||||
checkSubtype<Int>(a.b.c)
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !CHECK_TYPE
|
||||
|
||||
fun foo() {
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
interface A {
|
||||
val foo: Int
|
||||
val bar: String
|
||||
get() = ""
|
||||
}
|
||||
|
||||
fun test(foo: Int, bar: Int) {
|
||||
object : A {
|
||||
override val foo: Int = foo + bar
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
interface A {
|
||||
val foo: Int
|
||||
val bar: String
|
||||
|
||||
Reference in New Issue
Block a user