diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-03-16 20:55:18 -0400 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-03-16 20:55:18 -0400 |
commit | 63ea50be35afb6d7b9dbcd20fe3c31de6187858e (patch) | |
tree | 6356cb27f1285379aa5c46d7863ba7a25364e3f2 /tests/arr.toc | |
parent | 6855c6e752e4e4f2f37702477a3b461a51bbc614 (diff) |
updated tests, fixed bugs
Diffstat (limited to 'tests/arr.toc')
-rw-r--r-- | tests/arr.toc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/arr.toc b/tests/arr.toc index eee514a..5fb8328 100644 --- a/tests/arr.toc +++ b/tests/arr.toc @@ -1,3 +1,4 @@ +#include "mem.toc"; puti ::= fn(x: int) { //tcc's giving me "incompatible types for redefinition of 'printf'" for some reason (even though the declarations have the exact same type) #C("#ifndef __TINYC__ @@ -25,7 +26,7 @@ Arr ::= fn (t :: Type) Type { arr_add ::= fn(t :: Type, a : &Arr(t), x : t) { if a.len >= a.cap { a.cap = a.cap * 2 + 2; - new_data := new(t, a.cap); + new_data := news(t, a.cap); for i := 0..a.len-1 { new_data[i] = a.data[i]; } |