Nice type error if contract function is called as from a namespace
This commit is contained in:
@@ -577,6 +577,10 @@ failing_contracts() ->
|
||||
[<<?Pos(2, 3)
|
||||
"Only the main contract can contain defined functions or entrypoints.\n"
|
||||
"Fix: replace the definition of 'foo' by a type signature.">>])
|
||||
, ?TYPE_ERROR(contract_as_namespace,
|
||||
[<<?Pos(5, 28)
|
||||
"Invalid call to contract entrypoint 'Foo.foo'.\n"
|
||||
"It must be called as 'c.foo' for some c : Foo.">>])
|
||||
].
|
||||
|
||||
-define(Path(File), "code_errors/" ??File).
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
contract Foo =
|
||||
entrypoint foo : () => int
|
||||
|
||||
contract Fail =
|
||||
entrypoint bad() : int = Foo.foo()
|
||||
|
||||
Reference in New Issue
Block a user