[FIR] Report UNRESOLVED_REFERENCE on the first unresolved qualifier

#KT-55471 Fixed
This commit is contained in:
Kirill Rakhman
2023-08-28 12:44:36 +02:00
committed by Space Team
parent 40fadac060
commit 10f7989af6
69 changed files with 177 additions and 456 deletions
@@ -1,15 +0,0 @@
// !LANGUAGE: +ProhibitSmartcastsOnLocalDelegatedProperty
class AlternatingDelegate {
var counter: Int = 0
operator fun getValue(thisRef: Any?, property: <!UNRESOLVED_REFERENCE!>KProperty<*><!>): Any? =
if (counter++ % 2 == 0) 42 else ""
}
fun failsWithClassCastException() {
val sometimesNotInt: Any? by AlternatingDelegate()
if (sometimesNotInt is Int) {
<!SMARTCAST_IMPOSSIBLE!>sometimesNotInt<!>.inc()
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +ProhibitSmartcastsOnLocalDelegatedProperty
class AlternatingDelegate {
@@ -2,7 +2,7 @@
class AlternatingDelegate {
var counter: Int = 0
operator fun getValue(thisRef: Any?, property: <!UNRESOLVED_REFERENCE!>KProperty<*><!>): Any? =
operator fun getValue(thisRef: Any?, property: <!UNRESOLVED_REFERENCE!>KProperty<!><*>): Any? =
if (counter++ % 2 == 0) 42 else ""
}