Receiver smart casts: additional test for a?.b() when b is invokable property
This commit is contained in:
+12
@@ -121,4 +121,16 @@ fun falsePositive(w: Wrapper) {
|
||||
// Here we should NOT have smart cast
|
||||
<!SMARTCAST_IMPOSSIBLE!>w.unwrap()<!>.length
|
||||
}
|
||||
}
|
||||
|
||||
class Invokable(val x: String) {
|
||||
operator fun invoke() = x
|
||||
}
|
||||
|
||||
class InvokableProperty(val i: Invokable)
|
||||
|
||||
fun checkInvokable(ip: InvokableProperty?) {
|
||||
if (ip?.<!UNSAFE_IMPLICIT_INVOKE_CALL!>i<!>() == "Hello") {
|
||||
<!DEBUG_INFO_SMARTCAST!>ip<!>.hashCode()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user