[FIR] Implement FUNCTION_EXPECTED

This commit is contained in:
Ivan Kochurkin
2021-06-29 22:06:44 +03:00
parent 263e40e753
commit 2574dc907c
32 changed files with 146 additions and 58 deletions
@@ -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<!>()
}