From 0e486cd3642da8a442629ffce9a3daf16745c35e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 2 Apr 2016 16:18:43 +0200 Subject: Implement variable typing (via attributes) Now we can do: [string] str = foo --- tests/variable/type/buildfile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/variable/type/buildfile (limited to 'tests/variable/type/buildfile') diff --git a/tests/variable/type/buildfile b/tests/variable/type/buildfile new file mode 100644 index 0000000..372b0ad --- /dev/null +++ b/tests/variable/type/buildfile @@ -0,0 +1,21 @@ +# Variable typing. +# +[string] str1 = bar +str1 =+ foo +str1 += baz +print $str1 + +str2 = bar +[string] str2 =+ foo +str2 += baz +print $str2 + +#[string] str3 = foo +#[bool] str3 = false # error: changing str3 type from string to bool + +#[bool string] str3 = foo # error: multiple variable types: bool, string + +#[junk] jnk = foo # error: unknown variable attribute junk + + +./: -- cgit v1.1