summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
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