Get a callable reference expression to report an error on it properly, taking into account possible wrapping

^KT-42620 Fixed
This commit is contained in:
Victor Petukhov
2020-10-23 12:50:37 +03:00
parent cb020fb9f4
commit 4f06162446
12 changed files with 100 additions and 6 deletions
@@ -0,0 +1,15 @@
// SKIP_TXT
class Foo
fun main1() = when {
else -> <!UNRESOLVED_REFERENCE!>Foo::plus<!>
}
fun main2() = if (true) <!UNRESOLVED_REFERENCE!>Foo::minus<!> else <!UNRESOLVED_REFERENCE!>Foo::times<!>
fun main3() = if (true) { <!UNRESOLVED_REFERENCE!>Foo::minus<!> } else { <!UNRESOLVED_REFERENCE!>Foo::times<!> }
fun main4() = try { <!UNRESOLVED_REFERENCE!>Foo::minus<!> } finally { <!UNRESOLVED_REFERENCE!>Foo::times<!> }
fun main5() = <!UNRESOLVED_REFERENCE!>Foo::minus<!> ?: <!UNRESOLVED_REFERENCE!>Foo::times<!>
@@ -0,0 +1,15 @@
// SKIP_TXT
class Foo
fun main1() = when {
else -> Foo::<!CALLABLE_REFERENCE_RESOLUTION_AMBIGUITY!>plus<!>
}
fun main2() = if (true) Foo::<!CALLABLE_REFERENCE_RESOLUTION_AMBIGUITY!>minus<!> else Foo::<!CALLABLE_REFERENCE_RESOLUTION_AMBIGUITY!>times<!>
fun main3() = if (true) { Foo::<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>minus<!> } else { Foo::<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>times<!> }
fun main4() = try { Foo::<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>minus<!> } finally { <!UNUSED_EXPRESSION!>Foo::<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>times<!><!> }
fun main5() = Foo::<!CALLABLE_REFERENCE_RESOLUTION_AMBIGUITY!>minus<!> ?: Foo::<!CALLABLE_REFERENCE_RESOLUTION_AMBIGUITY!>times<!>