Remove the code error last_declaration_must_be_main_contract
This commit is contained in:
parent
9df883b155
commit
64682aa10c
@ -362,8 +362,6 @@ to_fcode(Env, [{Contract, Attrs, {con, _, Name}, _Impls, Decls}|Rest])
|
|||||||
Env1 = decls_to_fcode(Env#{ context => {abstract_contract, Name} }, Decls),
|
Env1 = decls_to_fcode(Env#{ context => {abstract_contract, Name} }, Decls),
|
||||||
to_fcode(Env1, Rest)
|
to_fcode(Env1, Rest)
|
||||||
end;
|
end;
|
||||||
to_fcode(_Env, [NotMain = {NotMainHead, _ ,_ , _}]) when NotMainHead =/= contract_def ->
|
|
||||||
fcode_error({last_declaration_must_be_main_contract, NotMain});
|
|
||||||
to_fcode(Env, [{namespace, _, {con, _, Con}, Decls} | Code]) ->
|
to_fcode(Env, [{namespace, _, {con, _, Con}, Decls} | Code]) ->
|
||||||
Env1 = decls_to_fcode(Env#{ context => {namespace, Con} }, Decls),
|
Env1 = decls_to_fcode(Env#{ context => {namespace, Con} }, Decls),
|
||||||
to_fcode(Env1, Code).
|
to_fcode(Env1, Code).
|
||||||
|
@ -10,10 +10,6 @@
|
|||||||
|
|
||||||
-export([format/1, pos/1]).
|
-export([format/1, pos/1]).
|
||||||
|
|
||||||
format({last_declaration_must_be_main_contract, Decl = {Kind, _, {con, _, C}, _}}) ->
|
|
||||||
Msg = io_lib:format("Expected a main contract as the last declaration instead of the ~p '~s'",
|
|
||||||
[Kind, C]),
|
|
||||||
mk_err(pos(Decl), Msg);
|
|
||||||
format({invalid_entrypoint, Why, Ann, {id, _, Name}, Thing}) ->
|
format({invalid_entrypoint, Why, Ann, {id, _, Name}, Thing}) ->
|
||||||
What = case Why of higher_order -> "higher-order (contains function types)";
|
What = case Why of higher_order -> "higher-order (contains function types)";
|
||||||
polymorphic -> "polymorphic (contains type variables)" end,
|
polymorphic -> "polymorphic (contains type variables)" end,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user