abouttreesummaryrefslogcommitdiff
path: root/test/test.toc
diff options
context:
space:
mode:
authorPatrick Schönberger2021-08-12 15:17:22 +0200
committerPatrick Schönberger2021-08-12 15:17:22 +0200
commit9f94b672a5dc32da5ad01742bd4e976315a30d9c (patch)
tree1d0f59296e5e3e49c8cd846dfd1237bcef747da4 /test/test.toc
parent66a27d2fc7c1ad4e97de76d4982168a0fed9920a (diff)
downloadtoc-9f94b672a5dc32da5ad01742bd4e976315a30d9c.tar.gz
toc-9f94b672a5dc32da5ad01742bd4e976315a30d9c.zip
fix function and method return types
Diffstat (limited to 'test/test.toc')
-rw-r--r--test/test.toc16
1 files changed, 14 insertions, 2 deletions
diff --git a/test/test.toc b/test/test.toc
index 38dc818..bff757a 100644
--- a/test/test.toc
+++ b/test/test.toc
@@ -7,13 +7,13 @@ var global1 : int;
var global2 : double = 123.45;
func globalFunc() : void {
- //puts("Hello\n");
+ puts("Hello\n");
}
// structs and functions can be declared generic
// by providing a list of placeholder typenames
struct S1<T1, T2> {
- t1: T1;
+ t1: T1 *;
t2: T1;
m1() : T2 {
@@ -76,6 +76,13 @@ namespace N1 {
}
}
+struct List<T> {
+ array: T *;
+ get(index: int): T {
+ return this->array[index];
+ }
+}
+
func main(argc : int, argv : char**) : int {
var s1 : N1::N2::S1;
var s2 : N1::N2::S1;
@@ -98,5 +105,10 @@ func main(argc : int, argv : char**) : int {
var s: N1::N2::S2;
s.abc();
+ var l1: List<int>;
+ l1.get(1);
+
+ var i1: int = generic1<int>(1, 2);
+
return 0;
} \ No newline at end of file