Add a compiler test for using namespace

This commit is contained in:
Gaith Hallak 2021-08-17 19:20:16 +03:00
parent 976f6c42ba
commit 06dc68a7f2
2 changed files with 32 additions and 0 deletions

View File

@ -200,6 +200,7 @@ compilable_contracts() ->
"clone_simple", "clone_simple",
"create", "create",
"child_contract_init_bug", "child_contract_init_bug",
"using_namespace",
"test" % Custom general-purpose test file. Keep it last on the list. "test" % Custom general-purpose test file. Keep it last on the list.
]. ].

View File

@ -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)