Solve GH suggestions

This commit is contained in:
radrow 2022-04-19 19:34:43 +02:00
parent 077aa584b5
commit 19d8f63131
4 changed files with 1 additions and 10 deletions

View File

@ -51,8 +51,6 @@ The **pp_** options all print to standard output the following:
`pp_assembler` - print the generated assembler code
`pp_bytecode` - print the bytecode instructions
#### check_call(ContractString, Options) -> CheckRet
Types

View File

@ -363,7 +363,7 @@ to_fcode(Env, [{Contract, Attrs, Con = {con, _, Name}, Decls}|Rest])
to_fcode(Env1, Rest)
end;
to_fcode(_Env, [NotMain = {NotMainHead, _ ,_ , _}]) when NotMainHead =/= contract_def ->
fcode_error({last_declaration_must_be_contract_def, NotMain});
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).

View File

@ -49,12 +49,6 @@ format({invalid_aens_resolve_type, Ann, T}) ->
"It must be a string or a pubkey type (address, oracle, etc).",
[pp_type(2, T)]),
mk_err(pos(Ann), Msg);
format({invalid_map_key_type, Why, Ann, Type}) ->
Msg = io_lib:format("Invalid map key type\n~s", [pp_type(2, Type)]),
Cxt = case Why of
function -> "Map keys cannot be higher-order."
end,
mk_err(pos(Ann), Msg, Cxt);
format({invalid_oracle_type, Why, What, Ann, Type}) ->
WhyS = case Why of higher_order -> "higher-order (contain function types)";
polymorphic -> "polymorphic (contain type variables)" end,

View File

@ -34,7 +34,6 @@
| pp_types
| pp_typed_ast
| pp_assembler
| pp_bytecode
| no_code
| keep_included
| debug_mode