Add a compiler test for using namespace
This commit is contained in:
parent
976f6c42ba
commit
06dc68a7f2
@ -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.
|
||||||
].
|
].
|
||||||
|
|
||||||
|
31
test/contracts/using_namespace.aes
Normal file
31
test/contracts/using_namespace.aes
Normal 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)
|
Loading…
x
Reference in New Issue
Block a user