FIR: Fix ambiguity between current Companion and one from supertypes
Companion as qualifier should be found at static scope not a member one
This commit is contained in:
@@ -0,0 +1,10 @@
|
|||||||
|
enum class A {
|
||||||
|
X, Y;
|
||||||
|
companion object {
|
||||||
|
fun foo(): Int {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun foo(): Int = Companion.foo()
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
FILE: companionAccessInEnum.kt
|
||||||
|
public final enum class A : R|kotlin/Enum<A>| {
|
||||||
|
private constructor(): R|A| {
|
||||||
|
super<R|kotlin/Enum<A>|>()
|
||||||
|
}
|
||||||
|
|
||||||
|
public final static enum entry X: R|A|
|
||||||
|
public final static enum entry Y: R|A|
|
||||||
|
public final companion object Companion : R|kotlin/Any| {
|
||||||
|
private constructor(): R|A.Companion| {
|
||||||
|
super<R|kotlin/Any|>()
|
||||||
|
}
|
||||||
|
|
||||||
|
public final fun foo(): R|kotlin/Int| {
|
||||||
|
^foo Int(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public final fun foo(): R|kotlin/Int| {
|
||||||
|
^foo Q|A.Companion|.R|/A.Companion.foo|()
|
||||||
|
}
|
||||||
|
|
||||||
|
public final static fun values(): R|kotlin/Array<A>| {
|
||||||
|
}
|
||||||
|
|
||||||
|
public final static fun valueOf(value: R|kotlin/String|): R|A| {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Generated
+5
@@ -48,6 +48,11 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest {
|
|||||||
runTest("compiler/fir/analysis-tests/testData/resolve/companion.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolve/companion.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("companionAccessInEnum.kt")
|
||||||
|
public void testCompanionAccessInEnum() throws Exception {
|
||||||
|
runTest("compiler/fir/analysis-tests/testData/resolve/companionAccessInEnum.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("companionObjectCall.kt")
|
@TestMetadata("companionObjectCall.kt")
|
||||||
public void testCompanionObjectCall() throws Exception {
|
public void testCompanionObjectCall() throws Exception {
|
||||||
runTest("compiler/fir/analysis-tests/testData/resolve/companionObjectCall.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolve/companionObjectCall.kt");
|
||||||
|
|||||||
+5
@@ -48,6 +48,11 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
|
|||||||
runTest("compiler/fir/analysis-tests/testData/resolve/companion.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolve/companion.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("companionAccessInEnum.kt")
|
||||||
|
public void testCompanionAccessInEnum() throws Exception {
|
||||||
|
runTest("compiler/fir/analysis-tests/testData/resolve/companionAccessInEnum.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("companionObjectCall.kt")
|
@TestMetadata("companionObjectCall.kt")
|
||||||
public void testCompanionObjectCall() throws Exception {
|
public void testCompanionObjectCall() throws Exception {
|
||||||
runTest("compiler/fir/analysis-tests/testData/resolve/companionObjectCall.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolve/companionObjectCall.kt");
|
||||||
|
|||||||
+5
@@ -48,6 +48,11 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
|
|||||||
runTest("compiler/fir/analysis-tests/testData/resolve/companion.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolve/companion.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("companionAccessInEnum.kt")
|
||||||
|
public void testCompanionAccessInEnum() throws Exception {
|
||||||
|
runTest("compiler/fir/analysis-tests/testData/resolve/companionAccessInEnum.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("companionObjectCall.kt")
|
@TestMetadata("companionObjectCall.kt")
|
||||||
public void testCompanionObjectCall() throws Exception {
|
public void testCompanionObjectCall() throws Exception {
|
||||||
runTest("compiler/fir/analysis-tests/testData/resolve/companionObjectCall.kt");
|
runTest("compiler/fir/analysis-tests/testData/resolve/companionObjectCall.kt");
|
||||||
|
|||||||
+1
-7
@@ -148,13 +148,7 @@ class MemberScopeTowerLevel(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
TowerScopeLevel.Token.Objects -> processMembers(processor) { consumer ->
|
TowerScopeLevel.Token.Objects -> ProcessorAction.NEXT
|
||||||
this.processClassifiersByName(name) {
|
|
||||||
// WARNING, DO NOT CAST FUNCTIONAL TYPE ITSELF
|
|
||||||
@Suppress("UNCHECKED_CAST")
|
|
||||||
consumer(it as T)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
// !LANGUAGE: -NestedClassesInEnumEntryShouldBeInner
|
// !LANGUAGE: -NestedClassesInEnumEntryShouldBeInner
|
||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
// IGNORE_BACKEND: NATIVE
|
// IGNORE_BACKEND: NATIVE
|
||||||
|
|
||||||
enum class E {
|
enum class E {
|
||||||
|
|||||||
+5
-5
@@ -28,7 +28,7 @@ object O {
|
|||||||
fun f() {
|
fun f() {
|
||||||
A.c
|
A.c
|
||||||
A.hashCode()
|
A.hashCode()
|
||||||
A().Nested
|
A().<!UNRESOLVED_REFERENCE!>Nested<!>
|
||||||
A.Nested()
|
A.Nested()
|
||||||
A().Inner()
|
A().Inner()
|
||||||
A.Companion.<!UNRESOLVED_REFERENCE!>Nested<!>
|
A.Companion.<!UNRESOLVED_REFERENCE!>Nested<!>
|
||||||
@@ -42,10 +42,10 @@ fun f() {
|
|||||||
A.Companion.c
|
A.Companion.c
|
||||||
A.Obj
|
A.Obj
|
||||||
A.Companion.Obj2
|
A.Companion.Obj2
|
||||||
A.Obj2
|
A.<!UNRESOLVED_REFERENCE!>Obj2<!>
|
||||||
A.Obj2.c
|
A.<!UNRESOLVED_REFERENCE!>Obj2<!>.<!UNRESOLVED_REFERENCE!>c<!>
|
||||||
A.Nested2
|
A.<!UNRESOLVED_REFERENCE!>Nested2<!>
|
||||||
|
|
||||||
O.O
|
O.O
|
||||||
O.A()
|
O.A()
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -33,12 +33,12 @@ enum class C {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun f() {
|
fun f() {
|
||||||
C.E1.A
|
C.E1.<!UNRESOLVED_REFERENCE!>A<!>
|
||||||
C.E1.<!UNRESOLVED_REFERENCE!>A<!>()
|
C.E1.<!UNRESOLVED_REFERENCE!>A<!>()
|
||||||
C.E2.B()
|
C.E2.B()
|
||||||
|
|
||||||
C.E2.O
|
C.E2.<!UNRESOLVED_REFERENCE!>O<!>
|
||||||
C.E3.O.InO
|
C.E3.<!UNRESOLVED_REFERENCE!>O<!>.<!UNRESOLVED_REFERENCE!>InO<!>
|
||||||
|
|
||||||
C.O
|
C.O
|
||||||
C.O.InO
|
C.O.InO
|
||||||
|
|||||||
+3
-3
@@ -33,12 +33,12 @@ enum class C {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun f() {
|
fun f() {
|
||||||
C.E1.A
|
C.E1.<!UNRESOLVED_REFERENCE!>A<!>
|
||||||
C.E1.<!UNRESOLVED_REFERENCE!>A<!>()
|
C.E1.<!UNRESOLVED_REFERENCE!>A<!>()
|
||||||
C.E2.B()
|
C.E2.B()
|
||||||
|
|
||||||
C.E2.O
|
C.E2.<!UNRESOLVED_REFERENCE!>O<!>
|
||||||
C.E3.O.InO
|
C.E3.<!UNRESOLVED_REFERENCE!>O<!>.<!UNRESOLVED_REFERENCE!>InO<!>
|
||||||
|
|
||||||
C.O
|
C.O
|
||||||
C.O.InO
|
C.O.InO
|
||||||
|
|||||||
Vendored
+1
-1
@@ -31,7 +31,7 @@ enum class Fruit(personal: Int) {
|
|||||||
|
|
||||||
// Another example from KT-11769
|
// Another example from KT-11769
|
||||||
enum class EnumCompanion1(val x: Int) {
|
enum class EnumCompanion1(val x: Int) {
|
||||||
INSTANCE(<!AMBIGUITY!>Companion<!>.<!UNRESOLVED_REFERENCE!>foo<!>()),
|
INSTANCE(Companion.foo()),
|
||||||
ANOTHER(foo());
|
ANOTHER(foo());
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|||||||
+19
-19
@@ -25,29 +25,29 @@ object Obj {
|
|||||||
|
|
||||||
fun test(with: WithClassObject, without: WithoutClassObject, obj: Obj) {
|
fun test(with: WithClassObject, without: WithoutClassObject, obj: Obj) {
|
||||||
with.<!UNRESOLVED_REFERENCE!>Nested<!>()
|
with.<!UNRESOLVED_REFERENCE!>Nested<!>()
|
||||||
with.NestedWithClassObject
|
with.<!UNRESOLVED_REFERENCE!>NestedWithClassObject<!>
|
||||||
with.<!UNRESOLVED_REFERENCE!>NestedWithClassObject<!>()
|
with.<!UNRESOLVED_REFERENCE!>NestedWithClassObject<!>()
|
||||||
with.NestedWithClassObject.foo()
|
with.<!UNRESOLVED_REFERENCE!>NestedWithClassObject<!>.<!UNRESOLVED_REFERENCE!>foo<!>()
|
||||||
with.NestedEnum.A
|
with.<!UNRESOLVED_REFERENCE!>NestedEnum<!>.<!UNRESOLVED_REFERENCE!>A<!>
|
||||||
with.NestedObj
|
with.<!UNRESOLVED_REFERENCE!>NestedObj<!>
|
||||||
with.NestedObj()
|
with.<!UNRESOLVED_REFERENCE!>NestedObj<!>()
|
||||||
with.NestedObj.foo()
|
with.<!UNRESOLVED_REFERENCE!>NestedObj<!>.<!UNRESOLVED_REFERENCE!>foo<!>()
|
||||||
|
|
||||||
without.<!UNRESOLVED_REFERENCE!>Nested<!>()
|
without.<!UNRESOLVED_REFERENCE!>Nested<!>()
|
||||||
without.NestedWithClassObject
|
without.<!UNRESOLVED_REFERENCE!>NestedWithClassObject<!>
|
||||||
without.<!UNRESOLVED_REFERENCE!>NestedWithClassObject<!>()
|
without.<!UNRESOLVED_REFERENCE!>NestedWithClassObject<!>()
|
||||||
without.NestedWithClassObject.foo()
|
without.<!UNRESOLVED_REFERENCE!>NestedWithClassObject<!>.<!UNRESOLVED_REFERENCE!>foo<!>()
|
||||||
without.NestedEnum.A
|
without.<!UNRESOLVED_REFERENCE!>NestedEnum<!>.<!UNRESOLVED_REFERENCE!>A<!>
|
||||||
without.NestedObj
|
without.<!UNRESOLVED_REFERENCE!>NestedObj<!>
|
||||||
without.NestedObj()
|
without.<!UNRESOLVED_REFERENCE!>NestedObj<!>()
|
||||||
without.NestedObj.foo()
|
without.<!UNRESOLVED_REFERENCE!>NestedObj<!>.<!UNRESOLVED_REFERENCE!>foo<!>()
|
||||||
|
|
||||||
obj.<!UNRESOLVED_REFERENCE!>Nested<!>()
|
obj.<!UNRESOLVED_REFERENCE!>Nested<!>()
|
||||||
obj.NestedWithClassObject
|
obj.<!UNRESOLVED_REFERENCE!>NestedWithClassObject<!>
|
||||||
obj.<!UNRESOLVED_REFERENCE!>NestedWithClassObject<!>()
|
obj.<!UNRESOLVED_REFERENCE!>NestedWithClassObject<!>()
|
||||||
obj.NestedWithClassObject.foo()
|
obj.<!UNRESOLVED_REFERENCE!>NestedWithClassObject<!>.<!UNRESOLVED_REFERENCE!>foo<!>()
|
||||||
obj.NestedEnum.A
|
obj.<!UNRESOLVED_REFERENCE!>NestedEnum<!>.<!UNRESOLVED_REFERENCE!>A<!>
|
||||||
obj.NestedObj
|
obj.<!UNRESOLVED_REFERENCE!>NestedObj<!>
|
||||||
obj.NestedObj()
|
obj.<!UNRESOLVED_REFERENCE!>NestedObj<!>()
|
||||||
obj.NestedObj.foo()
|
obj.<!UNRESOLVED_REFERENCE!>NestedObj<!>.<!UNRESOLVED_REFERENCE!>foo<!>()
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-7
@@ -119,8 +119,8 @@ class C : O.B() {
|
|||||||
val b = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>A<!>::foo<!>
|
val b = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>A<!>::foo<!>
|
||||||
|
|
||||||
// DEPRECATED: Classifiers from companions of direct superclasses
|
// DEPRECATED: Classifiers from companions of direct superclasses
|
||||||
val e = FromCompanionA::foo
|
val e = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>FromCompanionA<!>::foo<!>
|
||||||
val f = FromCompanionB::foo
|
val f = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>FromCompanionB<!>::foo<!>
|
||||||
|
|
||||||
// INVISIBLE: "cousin" supertypes themselves
|
// INVISIBLE: "cousin" supertypes themselves
|
||||||
val g = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>Alpha<!>::foo<!>
|
val g = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>Alpha<!>::foo<!>
|
||||||
@@ -128,9 +128,9 @@ class C : O.B() {
|
|||||||
val i = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>Gamma<!>::foo<!>
|
val i = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>Gamma<!>::foo<!>
|
||||||
|
|
||||||
// DEPRECATED: classifiers from "cousin" superclasses
|
// DEPRECATED: classifiers from "cousin" superclasses
|
||||||
val k = FromAlpha::foo
|
val k = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>FromAlpha<!>::foo<!>
|
||||||
val l = FromBeta::foo
|
val l = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>FromBeta<!>::foo<!>
|
||||||
val m = FromGamma::foo
|
val m = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>FromGamma<!>::foo<!>
|
||||||
|
|
||||||
// INVISIBLE: We don't see classifiers from companions of "cousin" superclasses
|
// INVISIBLE: We don't see classifiers from companions of "cousin" superclasses
|
||||||
val o = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>FromCompanionAlpha<!>::foo<!>
|
val o = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>FromCompanionAlpha<!>::foo<!>
|
||||||
@@ -138,5 +138,5 @@ class C : O.B() {
|
|||||||
val q = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>FromCompanionGamma<!>::foo<!>
|
val q = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>FromCompanionGamma<!>::foo<!>
|
||||||
|
|
||||||
// DEPRECATED: Classifiers from supertypes of our own companion
|
// DEPRECATED: Classifiers from supertypes of our own companion
|
||||||
val r = FromDelta::foo
|
val r = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>FromDelta<!>::foo<!>
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-7
@@ -119,8 +119,8 @@ class C : O.B() {
|
|||||||
val b = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>A<!>::foo<!>
|
val b = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>A<!>::foo<!>
|
||||||
|
|
||||||
// DEPRECATED: Classifiers from companions of direct superclasses
|
// DEPRECATED: Classifiers from companions of direct superclasses
|
||||||
val e = FromCompanionA::foo
|
val e = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>FromCompanionA<!>::foo<!>
|
||||||
val f = FromCompanionB::foo
|
val f = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>FromCompanionB<!>::foo<!>
|
||||||
|
|
||||||
// INVISIBLE: "cousin" supertypes themselves
|
// INVISIBLE: "cousin" supertypes themselves
|
||||||
val g = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>Alpha<!>::foo<!>
|
val g = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>Alpha<!>::foo<!>
|
||||||
@@ -128,9 +128,9 @@ class C : O.B() {
|
|||||||
val i = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>Gamma<!>::foo<!>
|
val i = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>Gamma<!>::foo<!>
|
||||||
|
|
||||||
// DEPRECATED: classifiers from "cousin" superclasses
|
// DEPRECATED: classifiers from "cousin" superclasses
|
||||||
val k = FromAlpha::foo
|
val k = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>FromAlpha<!>::foo<!>
|
||||||
val l = FromBeta::foo
|
val l = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>FromBeta<!>::foo<!>
|
||||||
val m = FromGamma::foo
|
val m = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>FromGamma<!>::foo<!>
|
||||||
|
|
||||||
// INVISIBLE: We don't see classifiers from companions of "cousin" superclasses
|
// INVISIBLE: We don't see classifiers from companions of "cousin" superclasses
|
||||||
val o = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>FromCompanionAlpha<!>::foo<!>
|
val o = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>FromCompanionAlpha<!>::foo<!>
|
||||||
@@ -138,5 +138,5 @@ class C : O.B() {
|
|||||||
val q = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>FromCompanionGamma<!>::foo<!>
|
val q = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>FromCompanionGamma<!>::foo<!>
|
||||||
|
|
||||||
// DEPRECATED: Classifiers from supertypes of our own companion
|
// DEPRECATED: Classifiers from supertypes of our own companion
|
||||||
val r = FromDelta::foo
|
val r = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>FromDelta<!>::foo<!>
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+5
-5
@@ -12,7 +12,7 @@ object A {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Derived : Base() {
|
class Derived : Base() {
|
||||||
val a = FromBaseCompanion::foo
|
val a = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>FromBaseCompanion<!>::foo<!>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ object B {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Derived : Base() {
|
class Derived : Base() {
|
||||||
val a = FromBaseCompanion::foo
|
val a = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>FromBaseCompanion<!>::foo<!>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ object C {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Derived : Base() {
|
class Derived : Base() {
|
||||||
val a = FromBaseCompanion::foo
|
val a = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>FromBaseCompanion<!>::foo<!>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,6 +64,6 @@ object D {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Derived : Base() {
|
class Derived : Base() {
|
||||||
val a = FromBaseCompanion::foo
|
val a = <!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>FromBaseCompanion<!>::foo<!>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,11 +5,11 @@ fun foo() {
|
|||||||
val b = object {
|
val b = object {
|
||||||
<!LOCAL_OBJECT_NOT_ALLOWED!>object c<!> {}
|
<!LOCAL_OBJECT_NOT_ALLOWED!>object c<!> {}
|
||||||
}
|
}
|
||||||
b.c
|
b.<!UNRESOLVED_REFERENCE!>c<!>
|
||||||
class A {
|
class A {
|
||||||
<!LOCAL_OBJECT_NOT_ALLOWED!>object d<!> {}
|
<!LOCAL_OBJECT_NOT_ALLOWED!>object d<!> {}
|
||||||
}
|
}
|
||||||
val f = {
|
val f = {
|
||||||
<!LOCAL_OBJECT_NOT_ALLOWED!>object e<!> {}
|
<!LOCAL_OBJECT_NOT_ALLOWED!>object e<!> {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+2
-2
@@ -32,8 +32,8 @@ fun testY() {
|
|||||||
|
|
||||||
fun test(x: X) {
|
fun test(x: X) {
|
||||||
val interface_as_fun = x.<!UNRESOLVED_REFERENCE!>A<!>()
|
val interface_as_fun = x.<!UNRESOLVED_REFERENCE!>A<!>()
|
||||||
val interface_as_val = x.A
|
val interface_as_val = x.<!UNRESOLVED_REFERENCE!>A<!>
|
||||||
|
|
||||||
val object_as_fun = x.<!UNRESOLVED_REFERENCE!>B<!>()
|
val object_as_fun = x.<!UNRESOLVED_REFERENCE!>B<!>()
|
||||||
val class_as_val = x.C
|
val class_as_val = x.<!UNRESOLVED_REFERENCE!>C<!>
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -62,7 +62,7 @@ fun foo(
|
|||||||
test.ObjectAlias::func
|
test.ObjectAlias::func
|
||||||
|
|
||||||
test.ObjectSample.Nested::func
|
test.ObjectSample.Nested::func
|
||||||
test.ObjectAlias.Nested::func
|
<!UNRESOLVED_REFERENCE!>test.ObjectAlias.<!UNRESOLVED_REFERENCE!>Nested<!>::func<!>
|
||||||
|
|
||||||
test.EnumSample::Nested
|
test.EnumSample::Nested
|
||||||
test.EnumAlias::Nested
|
test.EnumAlias::Nested
|
||||||
@@ -72,4 +72,4 @@ fun foo(
|
|||||||
|
|
||||||
test.EnumSample.Nested::func
|
test.EnumSample.Nested::func
|
||||||
<!UNRESOLVED_REFERENCE!>test.EnumAlias.<!UNRESOLVED_REFERENCE!>Nested<!>::func<!>
|
<!UNRESOLVED_REFERENCE!>test.EnumAlias.<!UNRESOLVED_REFERENCE!>Nested<!>::func<!>
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@
|
|||||||
* ISSUES: KT-39129
|
* ISSUES: KT-39129
|
||||||
*/
|
*/
|
||||||
fun case1() {
|
fun case1() {
|
||||||
C1.<!INAPPLICABLE_CANDIDATE!>V<!>()
|
C1.<!UNRESOLVED_REFERENCE!>V<!>()
|
||||||
|
|
||||||
C1.Companion.<!DEBUG_INFO_CALL("fqName: C1.Companion.V.V; typeCall: function")!>V()<!>
|
C1.Companion.<!DEBUG_INFO_CALL("fqName: C1.Companion.V.V; typeCall: function")!>V()<!>
|
||||||
|
|
||||||
|
|||||||
Vendored
-151
@@ -1,151 +0,0 @@
|
|||||||
// !LANGUAGE: +NewInference
|
|
||||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
|
||||||
// SKIP_TXT
|
|
||||||
|
|
||||||
// FILE: TestCase.kt
|
|
||||||
// TESTCASE NUMBER: 1
|
|
||||||
package testsCase1
|
|
||||||
|
|
||||||
open class A {
|
|
||||||
operator fun invoke() = print("invoke")
|
|
||||||
}
|
|
||||||
|
|
||||||
enum class Super_2 {
|
|
||||||
V1, V2;
|
|
||||||
|
|
||||||
companion object values : A() {}
|
|
||||||
|
|
||||||
private fun case() {
|
|
||||||
<!DEBUG_INFO_CALL("fqName: testsCase1.A.invoke; typeCall: variable&invoke")!>values()<!>
|
|
||||||
}
|
|
||||||
|
|
||||||
enum class NestedWithCompanion {
|
|
||||||
V1;
|
|
||||||
|
|
||||||
companion object values : A() {}
|
|
||||||
|
|
||||||
private fun case() {
|
|
||||||
<!DEBUG_INFO_CALL("fqName: testsCase1.A.invoke; typeCall: variable&invoke")!>values()<!>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
enum class Nested {
|
|
||||||
V1;
|
|
||||||
|
|
||||||
private fun case() {
|
|
||||||
<!DEBUG_INFO_CALL("fqName: testsCase1.Super_2.Nested.values; typeCall: function")!>values()<!>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// FILE: TestCase.kt
|
|
||||||
// TESTCASE NUMBER: 2
|
|
||||||
package testsCase2
|
|
||||||
|
|
||||||
open class A {
|
|
||||||
operator fun invoke(value: String) = print("invoke $value")
|
|
||||||
}
|
|
||||||
|
|
||||||
enum class Super_2 {
|
|
||||||
V1, V2;
|
|
||||||
|
|
||||||
companion object valueOf : A() {}
|
|
||||||
|
|
||||||
private fun case() {
|
|
||||||
<!DEBUG_INFO_CALL("fqName: testsCase2.A.invoke; typeCall: variable&invoke")!>valueOf("")<!>
|
|
||||||
}
|
|
||||||
|
|
||||||
enum class NestedWithCompanion {
|
|
||||||
V1;
|
|
||||||
|
|
||||||
companion object valueOf : A() {}
|
|
||||||
|
|
||||||
private fun case() {
|
|
||||||
<!DEBUG_INFO_CALL("fqName: testsCase2.A.invoke; typeCall: variable&invoke")!>valueOf("")<!>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
enum class Nested {
|
|
||||||
V1;
|
|
||||||
|
|
||||||
private fun case() {
|
|
||||||
<!DEBUG_INFO_CALL("fqName: testsCase2.Super_2.Nested.valueOf; typeCall: function")!>valueOf("")<!>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// FILE: TestCase.kt
|
|
||||||
// TESTCASE NUMBER: 3
|
|
||||||
package testsCase3
|
|
||||||
|
|
||||||
open class A {
|
|
||||||
operator fun invoke() = print("invoke")
|
|
||||||
}
|
|
||||||
|
|
||||||
enum class Super_2 {
|
|
||||||
V1, V2;
|
|
||||||
|
|
||||||
object values : A() {}
|
|
||||||
|
|
||||||
private fun case() {
|
|
||||||
<!DEBUG_INFO_CALL("fqName: testsCase3.A.invoke; typeCall: variable&invoke")!>values()<!>
|
|
||||||
}
|
|
||||||
|
|
||||||
enum class NestedWithCompanion {
|
|
||||||
V1;
|
|
||||||
|
|
||||||
object values : A() {}
|
|
||||||
|
|
||||||
private fun case() {
|
|
||||||
<!DEBUG_INFO_CALL("fqName: testsCase3.A.invoke; typeCall: variable&invoke")!>values()<!>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
enum class Nested {
|
|
||||||
V1;
|
|
||||||
|
|
||||||
private fun case() {
|
|
||||||
<!DEBUG_INFO_CALL("fqName: testsCase3.Super_2.Nested.values; typeCall: function")!>values()<!>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// FILE: TestCase.kt
|
|
||||||
// TESTCASE NUMBER: 4
|
|
||||||
package testsCase4
|
|
||||||
|
|
||||||
open class A {
|
|
||||||
operator fun invoke(value: String) = print("invoke $value")
|
|
||||||
}
|
|
||||||
open class B {
|
|
||||||
operator fun invoke(value: String) = print("invoke $value")
|
|
||||||
}
|
|
||||||
|
|
||||||
enum class Super_2 {
|
|
||||||
V1, V2;
|
|
||||||
|
|
||||||
object valueOf : A() {}
|
|
||||||
|
|
||||||
private fun case() {
|
|
||||||
<!DEBUG_INFO_CALL("fqName: testsCase4.A.invoke; typeCall: variable&invoke")!>valueOf("")<!>
|
|
||||||
}
|
|
||||||
|
|
||||||
enum class NestedWithCompanion {
|
|
||||||
V1;
|
|
||||||
|
|
||||||
object valueOf : B() {}
|
|
||||||
|
|
||||||
private fun case() {
|
|
||||||
<!DEBUG_INFO_CALL("fqName: testsCase4.B.invoke; typeCall: variable&invoke")!>valueOf("")<!>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
enum class Nested {
|
|
||||||
V1;
|
|
||||||
|
|
||||||
private fun case() {
|
|
||||||
<!DEBUG_INFO_CALL("fqName: testsCase4.Super_2.Nested.valueOf; typeCall: function")!>valueOf("")<!>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Vendored
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// !LANGUAGE: +NewInference
|
// !LANGUAGE: +NewInference
|
||||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
|
|||||||
Reference in New Issue
Block a user