Add failing test for ambiguous names

This commit is contained in:
Gaith Hallak 2021-08-18 13:57:40 +03:00
parent 8ac4156c87
commit 52b1c99ea7
2 changed files with 19 additions and 0 deletions

View File

@ -782,6 +782,12 @@ failing_contracts() ->
[<<?Pos(1,6)
"Only one main contract can be defined.">>
])
, ?TYPE_ERROR(using_namespace_ambiguous_name,
[ <<?Pos(2,3)
"Ambiguous name: Xa.f at line 2, column 3\nXb.f at line 5, column 3">>
, <<?Pos(13,23)
"Unbound variable A.f at line 13, column 23">>
])
].
-define(Path(File), "code_errors/" ??File).

View File

@ -0,0 +1,13 @@
namespace Xa =
function f() = 1
namespace Xb =
function f() = 2
contract Cntr =
using Xa as A
using Xb as A
type state = int
entrypoint init() = A.f()