Control-Flow: Compute type predicates for arguments of unresolved calls

This commit is contained in:
Alexey Sedunov
2015-05-20 16:14:21 +03:00
parent 036e2c585b
commit b6ea2d4fd4
10 changed files with 397 additions and 2 deletions
@@ -0,0 +1,31 @@
== foo ==
fun foo(i: Int) {}
---------------------
<v0>: Int NEW: magic[FAKE_INITIALIZER](i: Int) -> <v0>
=====================
== foo ==
fun foo(a: IntArray) {}
---------------------
<v0>: IntArray NEW: magic[FAKE_INITIALIZER](a: IntArray) -> <v0>
=====================
== foo ==
fun foo(a: String, b: Int) {}
---------------------
<v0>: String NEW: magic[FAKE_INITIALIZER](a: String) -> <v0>
<v1>: Int NEW: magic[FAKE_INITIALIZER](b: Int) -> <v1>
=====================
== foo ==
fun foo() {}
---------------------
=====================
== test ==
fun test() {
foo(bar())
}
---------------------
foo !<v2>: *
bar !<v0>: *
bar() <v1>: OR{{<: IntArray}, {<: Int}} NEW: magic[UNRESOLVED_CALL](bar()|!<v0>) -> <v1>
foo(bar()) <v3>: * NEW: magic[UNRESOLVED_CALL](foo(bar())|<v1>, !<v2>) -> <v3>
{ foo(bar()) } <v3>: * COPY
=====================