Remove unknown wanring error from type errors
This commit is contained in:
parent
add858a1ad
commit
6193d144a2
@ -393,9 +393,6 @@ mk_error({using_undefined_namespace_parts, Ann, Namespace, Parts}) ->
|
|||||||
PartsStr = lists:concat(lists:join(", ", Parts)),
|
PartsStr = lists:concat(lists:join(", ", Parts)),
|
||||||
Msg = io_lib:format("The namespace ~s does not define the following names: ~s", [Namespace, PartsStr]),
|
Msg = io_lib:format("The namespace ~s does not define the following names: ~s", [Namespace, PartsStr]),
|
||||||
mk_t_err(pos(Ann), Msg);
|
mk_t_err(pos(Ann), Msg);
|
||||||
mk_error({unknown_warning, Warning}) ->
|
|
||||||
Msg = io_lib:format("Trying to report unknown warning: ~p", [Warning]),
|
|
||||||
mk_t_err(pos(0, 0), Msg);
|
|
||||||
mk_error({empty_record_definition, Ann, Name}) ->
|
mk_error({empty_record_definition, Ann, Name}) ->
|
||||||
Msg = io_lib:format("Empty record definitions are not allowed. Cannot define the record `~s`", [Name]),
|
Msg = io_lib:format("Empty record definitions are not allowed. Cannot define the record `~s`", [Name]),
|
||||||
mk_t_err(pos(Ann), Msg);
|
mk_t_err(pos(Ann), Msg);
|
||||||
|
@ -8,12 +8,6 @@
|
|||||||
|
|
||||||
%% -- Moved functions --------------------------------------------------------
|
%% -- Moved functions --------------------------------------------------------
|
||||||
|
|
||||||
type_error(A) -> aeso_tc_errors:type_error(A).
|
|
||||||
create_type_errors() -> aeso_tc_errors:create_type_errors().
|
|
||||||
destroy_and_report_type_errors(A) -> aeso_tc_env:destroy_and_report_type_errors(A).
|
|
||||||
|
|
||||||
%% -------
|
|
||||||
|
|
||||||
all_warnings() -> aeso_tc_warnings:all_warnings().
|
all_warnings() -> aeso_tc_warnings:all_warnings().
|
||||||
|
|
||||||
%% ---------------------------------------------------------------------------
|
%% ---------------------------------------------------------------------------
|
||||||
@ -36,9 +30,9 @@ when_option(Opt, Do) ->
|
|||||||
when_warning(Warn, Do) ->
|
when_warning(Warn, Do) ->
|
||||||
case lists:member(Warn, all_warnings()) of
|
case lists:member(Warn, all_warnings()) of
|
||||||
false ->
|
false ->
|
||||||
create_type_errors(),
|
%% TODO: An error for passing invalid wanring name should be thrown here.
|
||||||
type_error({unknown_warning, Warn}),
|
%% Validation of compiler options might be done at an earlier stage.
|
||||||
destroy_and_report_type_errors(aeso_tc_env:init_env());
|
ok;
|
||||||
true ->
|
true ->
|
||||||
case aeso_tc_ets_manager:ets_tab_exists(warnings) of
|
case aeso_tc_ets_manager:ets_tab_exists(warnings) of
|
||||||
true ->
|
true ->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user