[FIR] Report UNRESOLVED_REFERENCE on the first unresolved qualifier
#KT-55471 Fixed
This commit is contained in:
committed by
Space Team
parent
40fadac060
commit
10f7989af6
-15
@@ -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 {
|
||||
|
||||
+1
-1
@@ -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 ""
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user