summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-05-13 11:59:35 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2020-05-13 11:59:35 -0400
commit2804529f75b149b579eb0f724358d519935ff08a (patch)
tree53d5826a4bdc7ee412ee4d1b045b92d07cb474e4 /tests
parentc466d81a2423d7122d7a0cbdc8059e69e88899f2 (diff)
fixed some problems with cgen_recurse_stuff
Diffstat (limited to 'tests')
-rw-r--r--tests/types.toc23
-rw-r--r--tests/types_expected2
2 files changed, 25 insertions, 0 deletions
diff --git a/tests/types.toc b/tests/types.toc
index 5117906..31d6962 100644
--- a/tests/types.toc
+++ b/tests/types.toc
@@ -20,6 +20,10 @@ main ::= fn() {
io.puti(f.k);
io.puti(f.b.f.k);
io.puti(f.b.f.b.f.k);
+ x := z.foo();
+ y ::= z.foo();
+ io.puti(x);
+ io.puti(y);
}
slice_to_ll ::= fn(t::=, slice: []t) use ll: LinkedList(t) {
@@ -45,3 +49,22 @@ Foo ::= struct {
Bar ::= struct {
f: Foo;
}
+
+z ::= nms {
+ Foo ::= struct(f ::= fn() int { 7 }) {
+ x: int;
+ }
+
+ Bar ::= fn() &(struct { x, y: int; f ::= fn() int { 13 } } ) {
+ x : u64;
+ &x as &void
+ }
+
+
+ foo ::= fn() total : int = 0 {
+ f: Foo();
+ total += f.f();
+ total += Bar().f();
+ }
+}
+
diff --git a/tests/types_expected b/tests/types_expected
index eef051c..f2d60e0 100644
--- a/tests/types_expected
+++ b/tests/types_expected
@@ -11,3 +11,5 @@
-173
0
9
+20
+20