Implement loading namespaces with the using keyword #829

Merged
ghallak merged 23 commits from ghallak/233 into master 2021-09-07 23:45:28 +09:00
2 changed files with 32 additions and 0 deletions
Showing only changes of commit 06dc68a7f2 - Show all commits

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)