Pseudocode: Generate instructions for superclass constructor calls. Consume value of delegate expression in the by-clause

This commit is contained in:
Alexey Sedunov
2014-06-26 20:16:08 +04:00
parent 523beab902
commit 1c75a5f642
17 changed files with 248 additions and 48 deletions
@@ -0,0 +1,24 @@
== T ==
trait T
---------------------
=====================
== A ==
class A(a: Int, b: Int): T
---------------------
<v0>: Int NEW: magic(a: Int) -> <v0>
<v1>: Int NEW: magic(b: Int) -> <v1>
=====================
== B ==
class B(a: Int, b: Int): T by A(a + b, a - b)
---------------------
<v0>: Int NEW: magic(a: Int) -> <v0>
<v1>: Int NEW: magic(b: Int) -> <v1>
a <v2>: Int NEW: r(a) -> <v2>
b <v3>: Int NEW: r(b) -> <v3>
a + b <v4>: Int NEW: call(a + b, plus|<v2>, <v3>) -> <v4>
a <v5>: Int NEW: r(a) -> <v5>
b <v6>: Int NEW: r(b) -> <v6>
a - b <v7>: Int NEW: call(a - b, minus|<v5>, <v6>) -> <v7>
A(a + b, a - b) <v8>: {<: T} NEW: call(A(a + b, a - b), <init>|<v4>, <v7>) -> <v8>
T by A(a + b, a - b) <v9>: * NEW: magic(T by A(a + b, a - b)|<v8>) -> <v9>
=====================