Ban using contracts as namespaces #919

Merged
ghallak merged 5 commits from ghallak/412 into master 2022-11-23 18:03:24 +09:00
3 changed files with 19 additions and 0 deletions
Showing only changes of commit 6499823e5f - Show all commits

View File

@ -1175,6 +1175,13 @@ failing_contracts() ->
[<<?Pos(5,16)
"`f` must be payable because the entrypoint `f` in the interface `I` is payable">>
])
, ?TYPE_ERROR(calling_child_contract_entrypoint,
[<<?Pos(5,20)
"Invalid call to contract entrypoint `F.g`.\n"
"It must be called as `c.g` for some `c : F`.">>])
, ?TYPE_ERROR(using_contract_as_namespace,
[<<?Pos(5,3)
"Cannot use undefined namespace F">>])
].
validation_test_() ->

View File

@ -0,0 +1,5 @@
contract F =
entrypoint g() = 1
main contract C =
entrypoint f() = F.g()

View File

@ -0,0 +1,7 @@
contract F =
entrypoint g() = 1
main contract C =
using F for [g]
entrypoint f() = g()