From 960583df2ff6f8baa205d0e1a5dd07667978b92a Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Tue, 10 Mar 2020 20:25:59 -0400 Subject: fixed varargs lookup --- test.toc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'test.toc') diff --git a/test.toc b/test.toc index 879562f..52672d8 100644 --- a/test.toc +++ b/test.toc @@ -1,9 +1,9 @@ #include "std/io.toc"; -f ::= fn(x :: ..) int { +f ::= fn(x : ..) int { total := 0; for a := x { - total += a; + total += a as int; } total }; @@ -12,5 +12,9 @@ main ::= fn() { puti(f(1,2,3)); puti(f(1,2,3,4,5,6)); puti(f(1,2,3,4)); + puti(f(1,7,3)); + puti(f(1,2,4,4,5,6)); + puti(f(1,2,-7.3,4.656)); -}; + puti(f(7.3,4.656)); +}; \ No newline at end of file -- cgit v1.2.3