Fail on function definitions in contracts other than the main contract

This commit is contained in:
Ulf Norell
2019-10-01 13:13:27 +02:00
parent 482d22d46b
commit 2d6d506d63
3 changed files with 39 additions and 12 deletions
+4
View File
@@ -573,6 +573,10 @@ failing_contracts() ->
<<?Pos(2, 1)
"Cannot compile with this version of the compiler,\n"
"because it does not satisfy the constraint ", Version/binary, " == 9.9.9">>])
, ?TYPE_ERROR(multiple_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.">>])
].
-define(Path(File), "code_errors/" ??File).
+5
View File
@@ -0,0 +1,5 @@
contract ContractOne =
entrypoint foo() = "foo"
contract ContractTwo =
entrypoint bar() = "bar"