[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
@@ -0,0 +1,24 @@
// MODULE: m1-common
// FILE: common.kt
expect class Foo
expect class Bar()
expect class Baz constructor()
expect class FooBar {
constructor()
}
fun test() {
<!EXPECT_CLASS_AS_FUNCTION!>Foo<!>()
Bar()
Baz()
FooBar()
}
// MODULE: m2-jvm()()(m1-common)
// FILE: jvm.kt
actual class Foo
actual class Bar
actual class Baz
actual class FooBar
@@ -1,4 +1,3 @@
// FIR_IDENTICAL
// MODULE: m1-common
// FILE: common.kt
@@ -34,7 +34,7 @@ interface KotlinXStringDemoInterface {
// FILE: StringDemoInterface.kt
actual typealias StringDemoInterface = KotlinXStringDemoInterface
<!ACTUAL_WITHOUT_EXPECT("actual fun StringDemoInterface.plusK(): <ERROR TYPE REF: Unresolved name: value>; The following declaration is incompatible: expect fun StringDemoInterface.plusK(): String")!>actual fun StringDemoIn<!INCOMPATIBLE_MATCHING!>terface.plusK() = <!RESOLUTION_TO_CLASSIFIER!>StringValue<!>(value).plus("K")<!>.<!UNRESOLVED_REFERENCE!>value<!><!>
<!ACTUAL_WITHOUT_EXPECT("actual fun StringDemoInterface.plusK(): <ERROR TYPE REF: Unresolved name: value>; The following declaration is incompatible: expect fun StringDemoInterface.plusK(): String")!>actual fun StringDemoIn<!INCOMPATIBLE_MATCHING!>terface.plusK() = <!EXPECT_CLASS_AS_FUNCTION!>StringValue<!>(value).plus("K")<!>.<!UNRESOLVED_REFERENCE!>value<!><!>
// FILE: main.kt
class StringDemo(override val value: String) : StringDemoInterface