]> git.lizzy.rs Git - metalua.git/blobdiff - src/samples/types_test.mlua
Merge branch 'master' of ssh://git.eclipse.org/gitroot/koneki/org.eclipse.koneki...
[metalua.git] / src / samples / types_test.mlua
diff --git a/src/samples/types_test.mlua b/src/samples/types_test.mlua
deleted file mode 100644 (file)
index 62f4a91..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
--{ extension "types" }
--{ extension "clist" }
-
--- Uncomment this to turn typechecking code generation off:
--- -{stat: types.enabled=false}
-
-function sum (x :: table(number)) :: number
-   local acc :: number = 0
-   for i=1, #x do
-      acc = acc + x[i] -- .. 'x' -- converts to string
-   end
-   --acc='bug' -- put a string in a number variable
-   return acc
-end
-
-x       = { i for i=1,100 }
---x[23] = 'toto' -- string in a number list, sum() will complain
-y       = sum (x)
-printf ("sum 1 .. %i = %i", #x, y)
\ No newline at end of file