From 2804529f75b149b579eb0f724358d519935ff08a Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Wed, 13 May 2020 11:59:35 -0400 Subject: fixed some problems with cgen_recurse_stuff --- tests/types.toc | 23 +++++++++++++++++++++++ tests/types_expected | 2 ++ 2 files changed, 25 insertions(+) (limited to 'tests') 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 -- cgit v1.2.3