summaryrefslogtreecommitdiff
path: root/test.toc
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-07-15 14:26:40 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2020-07-15 14:26:40 -0400
commitb408e5e2e67860026e24888eaf8e8081dd673f75 (patch)
tree9779108038c4dc57d4ed271518982ffc28d961fd /test.toc
parent64b66547c713ea23bc16a741bb2ad2ccdff3c1c8 (diff)
removed named struct args, fixed type information for struct instances
Diffstat (limited to 'test.toc')
-rw-r--r--test.toc11
1 files changed, 5 insertions, 6 deletions
diff --git a/test.toc b/test.toc
index ade7c93..4ca9f52 100644
--- a/test.toc
+++ b/test.toc
@@ -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;
}
}