From 64682aa10c135eb6fe95d6ecb13e27540cd06740 Mon Sep 17 00:00:00 2001 From: Gaith Hallak Date: Tue, 21 Jun 2022 19:57:01 +0400 Subject: [PATCH] Remove the code error last_declaration_must_be_main_contract --- src/aeso_ast_to_fcode.erl | 2 -- src/aeso_code_errors.erl | 4 ---- 2 files changed, 6 deletions(-) diff --git a/src/aeso_ast_to_fcode.erl b/src/aeso_ast_to_fcode.erl index 8c1a962..bfc55ee 100644 --- a/src/aeso_ast_to_fcode.erl +++ b/src/aeso_ast_to_fcode.erl @@ -362,8 +362,6 @@ to_fcode(Env, [{Contract, Attrs, {con, _, Name}, _Impls, Decls}|Rest]) Env1 = decls_to_fcode(Env#{ context => {abstract_contract, Name} }, Decls), to_fcode(Env1, Rest) 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]) -> Env1 = decls_to_fcode(Env#{ context => {namespace, Con} }, Decls), to_fcode(Env1, Code). diff --git a/src/aeso_code_errors.erl b/src/aeso_code_errors.erl index 70f9c47..bdecaa0 100644 --- a/src/aeso_code_errors.erl +++ b/src/aeso_code_errors.erl @@ -10,10 +10,6 @@ -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}) -> What = case Why of higher_order -> "higher-order (contains function types)"; polymorphic -> "polymorphic (contains type variables)" end,