[FIR] Additional errors to distinguish resolution to classifier cases

When a call is resolved to a classifier, only a single error message was
being used for multiple cases. This lead to confusion as the default
message may not be applicable to a given error case. Added additional
errors and messages to distinguish between these error cases.

#KT-57251 Fixed
This commit is contained in:
Brian Norman
2023-06-02 09:34:49 -05:00
committed by Space Team
parent ac79633590
commit 0ff9982b31
44 changed files with 582 additions and 39 deletions
@@ -35,10 +35,10 @@ class E: A() {
object Z {
init {
<!RESOLUTION_TO_CLASSIFIER!>B<!>().<!UNRESOLVED_REFERENCE!>foo<!>()
<!RESOLUTION_TO_CLASSIFIER!>B<!>().<!UNRESOLVED_REFERENCE!>bar<!>()
<!INNER_CLASS_CONSTRUCTOR_NO_RECEIVER!>B<!>().<!UNRESOLVED_REFERENCE!>foo<!>()
<!INNER_CLASS_CONSTRUCTOR_NO_RECEIVER!>B<!>().<!UNRESOLVED_REFERENCE!>bar<!>()
<!RESOLUTION_TO_CLASSIFIER!>D<!>()
<!INNER_CLASS_CONSTRUCTOR_NO_RECEIVER!>D<!>()
<!UNRESOLVED_REFERENCE!>C<!>()
}
}
@@ -60,7 +60,7 @@ class F: A() {
companion object {
init {
B().fas()
<!RESOLUTION_TO_CLASSIFIER!>D<!>().<!UNRESOLVED_REFERENCE!>f<!>()
<!INNER_CLASS_CONSTRUCTOR_NO_RECEIVER!>D<!>().<!UNRESOLVED_REFERENCE!>f<!>()
}
}
}
@@ -0,0 +1,90 @@
// FILE: A.java
public interface A {
public class A_S { // static
}
}
// FILE: B.java
public class B {
public static class B_S {
}
public class B_ {
}
}
// FILE: C.java
public class C extends B implements A {
}
// FILE: 1.kt
class X: A {
val a_s: <!UNRESOLVED_REFERENCE!>A_S<!> = null!!
init {
<!UNRESOLVED_REFERENCE!>A_S<!>()
A.A_S()
X.<!UNRESOLVED_REFERENCE!>A_S<!>()
}
object xD {
val a_: <!UNRESOLVED_REFERENCE!>A_S<!> = null!!
init {
<!UNRESOLVED_REFERENCE!>A_S<!>()
}
}
}
class Y: B() {
val b_: B_ = null!!
val b_s: B_S = null!!
init {
B_()
B.<!INNER_CLASS_CONSTRUCTOR_NO_RECEIVER!>B_<!>()
Y.<!UNRESOLVED_REFERENCE!>B_<!>()
B_S()
B.B_S()
Y.<!UNRESOLVED_REFERENCE!>B_S<!>()
}
object X {
val b_: B_ = null!!
val b_s: B_S = null!!
init {
<!INNER_CLASS_CONSTRUCTOR_NO_RECEIVER!>B_<!>()
B_S()
}
}
}
class Z: C() {
val a_s: <!UNRESOLVED_REFERENCE!>A_S<!> = null!!
val b_: B_ = null!!
val b_s: B_S = null!!
init {
<!UNRESOLVED_REFERENCE!>A_S<!>()
B_()
B_S()
}
object X {
val a_s: <!UNRESOLVED_REFERENCE!>A_S<!> = null!!
val b_: B_ = null!!
val b_s: B_S = null!!
init {
<!UNRESOLVED_REFERENCE!>A_S<!>()
<!INNER_CLASS_CONSTRUCTOR_NO_RECEIVER!>B_<!>()
B_S()
}
}
}
@@ -1,4 +1,3 @@
// FIR_IDENTICAL
// FILE: A.java
public interface A {
public class A_S { // static
@@ -0,0 +1,82 @@
// FILE: A.java
public interface A {
class A_S {
}
}
// FILE: B.java
public class B {
static class B_S {
}
class B_ {
}
}
// FILE: C.java
public class C extends B implements A {
}
// FILE: 1.kt
interface E {
class E_S
}
open class D: C(), E
// FILE: F.java
public class F extends D {
}
// FILE: 2.kt
class X: D() {
init {
B_()
B.<!INNER_CLASS_CONSTRUCTOR_NO_RECEIVER!>B_<!>()
C.<!UNRESOLVED_REFERENCE!>B_<!>()
D.<!UNRESOLVED_REFERENCE!>B_<!>()
X.<!UNRESOLVED_REFERENCE!>B_<!>()
<!UNRESOLVED_REFERENCE!>A_S<!>()
A.A_S()
C.<!UNRESOLVED_REFERENCE!>A_S<!>()
D.<!UNRESOLVED_REFERENCE!>A_S<!>()
X.<!UNRESOLVED_REFERENCE!>A_S<!>()
B_S()
B.B_S()
C.<!UNRESOLVED_REFERENCE!>B_S<!>()
D.<!UNRESOLVED_REFERENCE!>B_S<!>()
X.<!UNRESOLVED_REFERENCE!>B_S<!>()
<!UNRESOLVED_REFERENCE!>E_S<!>()
E.E_S()
D.<!UNRESOLVED_REFERENCE!>E_S<!>()
X.<!UNRESOLVED_REFERENCE!>E_S<!>()
}
}
class Y: F() {
init {
B_()
F.<!UNRESOLVED_REFERENCE!>B_<!>()
Y.<!UNRESOLVED_REFERENCE!>B_<!>()
<!UNRESOLVED_REFERENCE!>A_S<!>()
F.<!UNRESOLVED_REFERENCE!>A_S<!>()
Y.<!UNRESOLVED_REFERENCE!>A_S<!>()
B_S()
F.<!UNRESOLVED_REFERENCE!>B_S<!>()
Y.<!UNRESOLVED_REFERENCE!>B_S<!>()
<!UNRESOLVED_REFERENCE!>E_S<!>()
F.<!UNRESOLVED_REFERENCE!>E_S<!>()
Y.<!UNRESOLVED_REFERENCE!>E_S<!>()
}
}
@@ -1,4 +1,3 @@
// FIR_IDENTICAL
// FILE: A.java
public interface A {
class A_S {