diff --git a/test/contracts/funargs.aes b/test/contracts/funargs.aes new file mode 100644 index 0000000..808c1e8 --- /dev/null +++ b/test/contracts/funargs.aes @@ -0,0 +1,47 @@ + +contract FunctionArguments = + + function sum(n : int, m: int) = + n + m + + function append(xs : list(string)) = + switch(xs) + [] => "" + y :: ys => String.concat(y, append(ys)) + + function menot(b) = + !b + + function bitsum(b : bits) = + Bits.sum(b) + + record answer('a) = {label : string, result : 'a} + + function read(a : answer(int)) = + a.result + + function sjutton(b : bytes(17)) = + b + + function sextiosju(b : bytes(67)) = + b + + function trettiotva(b : bytes(32)) = + b + + function find_oracle(o : oracle(int, bool)) = + true + + function find_query(q : oracle_query(int, bool)) = + true + + datatype colour() = Green | Yellow | Red | Pantone(int) + + function traffic_light(c : colour) = + Red + + function tuples(t : ()) = + t + + function due(t : Chain.ttl) = + true