diff --git a/test/aeso_compiler_tests.erl b/test/aeso_compiler_tests.erl index 1df9bf3..8b531e7 100644 --- a/test/aeso_compiler_tests.erl +++ b/test/aeso_compiler_tests.erl @@ -200,6 +200,7 @@ compilable_contracts() -> "clone_simple", "create", "child_contract_init_bug", + "using_namespace", "test" % Custom general-purpose test file. Keep it last on the list. ]. diff --git a/test/contracts/using_namespace.aes b/test/contracts/using_namespace.aes new file mode 100644 index 0000000..ae20706 --- /dev/null +++ b/test/contracts/using_namespace.aes @@ -0,0 +1,31 @@ +include "Option.aes" +include "Pair.aes" +include "String.aes" + +using Pair + +namespace Nsp = + using Option + + function h() = + let op = Some(2) + is_some(op) + +contract Cntr = + using Nsp + + entrypoint init() = () + + function f() = + let p = (1, 2) + if (h()) + fst(p) + else + snd(p) + + function g() = + using String + + let s1 = "abc" + let s2 = "def" + concat(s1, s2)