@@ -118,7 +118,10 @@ format_warnings(Opts, Warnings) ->
118118% % Those we implement ourselves
119119handle_file_warning (_ , _File , {_Line , v3_core , {map_key_repeated , _ }}) -> ok ;
120120handle_file_warning (_ , _File , {_Line , sys_core_fold , {ignored , useless_building }}) -> ok ;
121- handle_file_warning (_ , _File , {_Line , sys_core_fold , {nomatch , _ }}) -> ok ;
121+
122+ % % We skip all of no_clause, clause_type, guard, shadow.
123+ % % Those have too little information and they overlap with the type system.
124+ handle_file_warning (_ , _File , {_Line , sys_core_fold , {nomatch , Reason }}) when is_atom (Reason ) -> ok ;
122125
123126% % Ignore all linting errors (only come up on parse transforms)
124127handle_file_warning (_ , _File , {_Line , erl_lint , _ }) -> ok ;
@@ -151,6 +154,14 @@ custom_format(sys_core_fold, {ignored, {no_effect, {erlang, F, A}}}) ->
151154 end ,
152155 io_lib :format (Fmt , Args );
153156
157+ custom_format (sys_core_fold , {nomatch , {shadow , Line , {ErlName , ErlArity }}}) ->
158+ {Name , Arity } = elixir_utils :erl_fa_to_elixir_fa (ErlName , ErlArity ),
159+
160+ io_lib :format (
161+ " this clause for ~ts /~B cannot match because a previous clause at line ~B always matches" ,
162+ [Name , Arity , Line ]
163+ );
164+
154165custom_format ([], Desc ) ->
155166 io_lib :format (" ~p " , [Desc ]);
156167
0 commit comments