PT-168026292 structured error messages #631

Merged
zxq9 merged 20 commits from PT-168026292-structured_error_messages into master 2019-09-05 16:03:20 +09:00
Showing only changes of commit db7bf7a730 - Show all commits

View File

@ -2195,7 +2195,7 @@ mk_error({reserved_entrypoint, Name, Def}) ->
mk_error({duplicate_definition, Name, Locs}) ->
Msg = io_lib:format("Duplicate definitions of ~s at\n~s",
[Name, [ [" - ", pp_loc(L), "\n"] || L <- Locs ]]),
mk_t_err(pos(hd(Locs)), Msg);
mk_t_err(pos(lists:last(Locs)), Msg);
mk_error({duplicate_scope, Kind, Name, OtherKind, L}) ->
Msg = io_lib:format("The ~p ~s (at ~s) has the same name as a ~p at ~s\n",
[Kind, pp(Name), pp_loc(Name), OtherKind, pp_loc(L)]),