[FIR] Implement FUNCTION_EXPECTED
This commit is contained in:
Vendored
+2
-2
@@ -12,5 +12,5 @@ public fun foo(xx: Any): Int {
|
||||
y.length
|
||||
} while (true)
|
||||
// We could have smart cast here but with break it's hard to detect
|
||||
return x.<!UNRESOLVED_REFERENCE!>length<!>()
|
||||
}
|
||||
return x.<!FUNCTION_EXPECTED!>length<!>()
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
fun x(): Boolean { return true }
|
||||
|
||||
public fun foo(pp: Any): Int {
|
||||
var p = pp
|
||||
while(true) {
|
||||
(p as String).length
|
||||
if (x()) break
|
||||
p = 42
|
||||
}
|
||||
// Smart cast is NOT possible here
|
||||
// (we could provide it but p = 42 makes it difficult to understand)
|
||||
return p.<!FUNCTION_EXPECTED!>length<!>()
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
// FIR_IDENTICAL
|
||||
fun x(): Boolean { return true }
|
||||
|
||||
public fun foo(pp: Any): Int {
|
||||
@@ -11,4 +10,4 @@ public fun foo(pp: Any): Int {
|
||||
// Smart cast is NOT possible here
|
||||
// (we could provide it but p = 42 makes it difficult to understand)
|
||||
return p.<!UNRESOLVED_REFERENCE!>length<!>()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user