diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-07-15 14:26:40 -0400 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-07-15 14:26:40 -0400 |
commit | b408e5e2e67860026e24888eaf8e8081dd673f75 (patch) | |
tree | 9779108038c4dc57d4ed271518982ffc28d961fd /test.toc | |
parent | 64b66547c713ea23bc16a741bb2ad2ccdff3c1c8 (diff) |
removed named struct args, fixed type information for struct instances
Diffstat (limited to 'test.toc')
-rw-r--r-- | test.toc | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -2,7 +2,6 @@ #include "std/io.toc", io; #include "std/types.toc"; - write_type ::= fn(f : &File, t :: Type) { k ::= t._kind; use TypeKind; @@ -138,7 +137,7 @@ main ::= fn() { t : [x*x]int; u := &t; v : &void; - p: Point; + p: Point(u8); print_typeof(x); print_typeof(y); @@ -154,11 +153,11 @@ main ::= fn() { xx ::= fn() (int, int) { return 3, 5; } - Point2D ::= struct { - x, y : int; + Point2D ::= struct(t :: Type) { + x, y : t; } - Point ::= struct { - use p: Point2D; + Point ::= struct(t :: Type) { + use p: Point2D(t); z: float; } } |