diff --git a/src/aeso_ast_to_fcode.erl b/src/aeso_ast_to_fcode.erl index f112230..f69ee86 100644 --- a/src/aeso_ast_to_fcode.erl +++ b/src/aeso_ast_to_fcode.erl @@ -1459,6 +1459,8 @@ get_attributes(Ann) -> indexed(Xs) -> lists:zip(lists:seq(1, length(Xs)), Xs). +-dialyzer({nowarn_function, [fcode_error/1, internal_error/1]}). + fcode_error(Error) -> aeso_errors:throw(aeso_code_errors:format(Error)). diff --git a/src/aeso_ast_to_icode.erl b/src/aeso_ast_to_icode.erl index cde1ce7..2a9ef27 100644 --- a/src/aeso_ast_to_icode.erl +++ b/src/aeso_ast_to_icode.erl @@ -41,6 +41,7 @@ code([], Icode, Options) -> %% Generate error on correct format. +-dialyzer({nowarn_function, gen_error/1}). gen_error(Error) -> aeso_errors:throw(aeso_code_errors:format(Error)). @@ -731,6 +732,7 @@ eta_expand(Id = {_, Ann0, _}, {fun_t, _, _, ArgsT, _}, Icode) -> check_monomorphic_map({typed, Ann, _, MapType}, Icode) -> check_monomorphic_map(Ann, MapType, Icode). +-dialyzer({nowarn_function, check_monomorphic_map/3}). check_monomorphic_map(Ann, ?map_t(KeyType, ValType), _Icode) -> Err = fun(Why) -> gen_error({invalid_map_key_type, Why, Ann, KeyType}) end, [ Err(polymorphic) || not is_monomorphic(KeyType) ], diff --git a/src/aeso_errors.erl b/src/aeso_errors.erl index b96794c..d22c56e 100644 --- a/src/aeso_errors.erl +++ b/src/aeso_errors.erl @@ -50,6 +50,7 @@ pos(Line, Col) -> pos(File, Line, Col) -> #pos{ file = File, line = Line, col = Col }. +-spec throw(_) -> ok | no_return(). throw([]) -> ok; throw(Errs) when is_list(Errs) -> erlang:throw({error, Errs}); diff --git a/src/aeso_parser.erl b/src/aeso_parser.erl index 6eecca7..4c3d50d 100644 --- a/src/aeso_parser.erl +++ b/src/aeso_parser.erl @@ -33,10 +33,10 @@ string(String, Included, Opts) -> {ok, AST} -> case expand_includes(AST, Included, Opts) of {ok, AST1} -> AST1; - {error, Err} -> aeso_errors:throw(mk_error(Err)) + {error, Err} -> parse_error(Err) end; {error, Err} -> - aeso_errors:throw(mk_error(Err)) + parse_error(Err) end. type(String) -> @@ -52,6 +52,10 @@ parse_and_scan(P, S, Opts) -> Error -> Error end. +-dialyzer({nowarn_function, parse_error/1}). +parse_error(Err) -> + aeso_errors:throw(mk_error(Err)). + mk_p_err(Pos, Msg) -> aeso_errors:new(parse_error, mk_pos(Pos), lists:flatten(Msg)).