Pseudocode: Implement computation of expected type predicates

This commit is contained in:
Alexey Sedunov
2014-06-23 14:02:22 +04:00
parent 50228fa085
commit 5e2c2b4eca
87 changed files with 1154 additions and 803 deletions
@@ -15,7 +15,7 @@ class AnonymousInitializers() {
}
}
---------------------
34 <v0> NEW()
12 <v2> NEW()
13 <v4> NEW()
34 <v0>: Int NEW()
12 <v2>: Int NEW()
13 <v4>: Int NEW()
=====================
@@ -3,8 +3,8 @@ fun foo() {
{}
}
---------------------
{} <v0> NEW()
{ {} } <v0> COPY
{} <v0>: * NEW()
{ {} } <v0>: * COPY
=====================
== anonymous_0 ==
{}
@@ -3,6 +3,6 @@ fun fail() : Nothing {
throw java.lang.RuntimeException()
}
---------------------
RuntimeException() <v0> NEW()
java.lang.RuntimeException() <v0> COPY
RuntimeException() <v0>: {<: Throwable} NEW()
java.lang.RuntimeException() <v0>: {<: Throwable} COPY
=====================
@@ -3,6 +3,6 @@ fun <T> foo() {
T
}
---------------------
T <v0> NEW()
{ T } <v0> COPY
T <v0>: * NEW()
{ T } <v0>: * COPY
=====================
@@ -17,7 +17,7 @@ class C() {
}
}
---------------------
1 <v0> NEW()
1 <v0>: Int NEW()
=====================
== doSmth ==
fun doSmth(i: Int) {}
@@ -33,8 +33,8 @@ fun test1() {
}
}
---------------------
1 <v1> NEW()
object { val x : Int { $x = 1 } } <v2> NEW()
1 <v1>: Int NEW()
object { val x : Int { $x = 1 } } <v2>: <no name provided> NEW()
=====================
== O ==
object O {
@@ -44,7 +44,7 @@ object O {
}
}
---------------------
1 <v1> NEW()
1 <v1>: Int NEW()
=====================
== test2 ==
fun test2() {
@@ -54,9 +54,9 @@ fun test2() {
}
}
---------------------
1 <v0> NEW()
b <v1> NEW()
object { val x = b } <v2> NEW()
1 <v0>: Int NEW()
b <v1>: Int NEW()
object { val x = b } <v2>: <no name provided> NEW()
=====================
== test3 ==
fun test3() {
@@ -68,14 +68,14 @@ fun test3() {
}
}
---------------------
object { val y : Int fun inner_bar() { y = 10 } } <v0> NEW()
object { val y : Int fun inner_bar() { y = 10 } } <v0>: <no name provided> NEW()
=====================
== inner_bar ==
fun inner_bar() {
y = 10
}
---------------------
10 <v1> NEW()
10 <v1>: Int NEW()
=====================
== test4 ==
fun test4() {
@@ -91,15 +91,15 @@ fun test4() {
}
}
---------------------
1 <v1> NEW()
object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } } <v2> NEW()
1 <v1>: Int NEW()
object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } } <v2>: <no name provided> NEW()
=====================
== ggg ==
fun ggg() {
y = 10
}
---------------------
10 <v1> NEW()
10 <v1>: Int NEW()
=====================
== test5 ==
fun test5() {
@@ -117,21 +117,21 @@ fun test5() {
}
}
---------------------
1 <v0> NEW()
2 <v2> NEW()
object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } } <v3> NEW()
1 <v0>: Int NEW()
2 <v2>: Int NEW()
object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } } <v3>: <no name provided> NEW()
=====================
== foo ==
fun foo() {
x = 3
}
---------------------
3 <v1> NEW()
3 <v1>: Int NEW()
=====================
== bar ==
fun bar() {
x = 4
}
---------------------
4 <v1> NEW()
4 <v1>: Int NEW()
=====================
@@ -17,7 +17,7 @@ class B : A {
== foo ==
override fun foo() = 10
---------------------
10 <v0> NEW()
10 <v0>: Int NEW()
=====================
== foo ==
fun foo(b: B) : Int {
@@ -25,9 +25,9 @@ fun foo(b: B) : Int {
return o.foo()
}
---------------------
b <v1> NEW()
object : A by b {} <v2> NEW()
o <v3> NEW()
foo() <v4> NEW(<v3>)
o.foo() <v4> COPY
b <v1>: * NEW()
object : A by b {} <v2>: <no name provided> NEW()
o <v3>: {<: A} NEW()
foo() <v4>: Int NEW(<v3>)
o.foo() <v4>: Int COPY
=====================
@@ -21,12 +21,12 @@ fun f() {
}
}
---------------------
"" <v0> NEW()
"" <v0>: String NEW()
=====================
== loc ==
fun loc() {
val x3 = ""
}
---------------------
"" <v0> NEW()
"" <v0>: String NEW()
=====================
@@ -16,5 +16,5 @@ get() {
return b
}
---------------------
b <v0> NEW()
b <v0>: Int NEW()
=====================
@@ -8,12 +8,12 @@ class C {
== component1 ==
fun component1() = 1
---------------------
1 <v0> NEW()
1 <v0>: Int NEW()
=====================
== component2 ==
fun component2() = 2
---------------------
2 <v0> NEW()
2 <v0>: Int NEW()
=====================
== test ==
fun test(c: C) {
@@ -21,8 +21,8 @@ fun test(c: C) {
val d = 1
}
---------------------
a <v2> NEW(<v1>)
b <v3> NEW(<v1>)
c <v1> NEW()
1 <v4> NEW()
a <v2>: Int NEW(<v1>)
b <v3>: Int NEW(<v1>)
c <v1>: C NEW()
1 <v4>: Int NEW()
=====================
@@ -4,7 +4,7 @@ fun foo(x: Int) {
a
}
---------------------
x <v1> NEW()
a <v4> NEW()
{ val (a, b) = x a } <v4> COPY
x <v1>: * NEW()
a <v4>: * NEW()
{ val (a, b) = x a } <v4>: * COPY
=====================
@@ -7,15 +7,15 @@ class Delegate {
== get ==
fun get(_this: Any, p: PropertyMetadata): Int = 0
---------------------
0 <v2> NEW()
0 <v2>: Int NEW()
=====================
== a ==
val a = Delegate()
---------------------
Delegate() <v0> NEW()
Delegate() <v0>: Delegate NEW()
=====================
== b ==
val b by a
---------------------
a <v0> NEW()
a <v0>: * NEW()
=====================
@@ -8,6 +8,6 @@ class C {
}
}
---------------------
$a <v1> NEW(<v0>)
{ $a } <v1> COPY
$a <v1>: * NEW(<v0>)
{ $a } <v1>: * COPY
=====================
@@ -8,10 +8,10 @@ abstract class Bar {
== foo ==
fun foo() = "foo" + this.$bar
---------------------
"foo" <v0> NEW()
this <v1> COPY
this <v1> NEW()
$bar <v2> NEW(<v1>)
this.$bar <v2> COPY
"foo" + this.$bar <v3> NEW(<v0>, <v2>)
"foo" <v0>: String NEW()
this <v1>: {<: Bar} COPY
this <v1>: {<: Bar} NEW()
$bar <v2>: {<: Any?} NEW(<v1>)
this.$bar <v2>: {<: Any?} COPY
"foo" + this.$bar <v3>: String NEW(<v0>, <v2>)
=====================