Mark only included files as potentially unused
This commit is contained in:
parent
311bf49505
commit
45d0c5996a
@ -3207,9 +3207,14 @@ when_warning(Warn, Do) ->
|
|||||||
%% Warnings (Unused includes)
|
%% Warnings (Unused includes)
|
||||||
|
|
||||||
potential_unused_include(Ann, SrcFile) ->
|
potential_unused_include(Ann, SrcFile) ->
|
||||||
|
IsIncluded = aeso_syntax:get_ann(include_type, Ann, none) =/= none,
|
||||||
|
case IsIncluded of
|
||||||
|
false -> ok;
|
||||||
|
true ->
|
||||||
case aeso_syntax:get_ann(file, Ann, no_file) of
|
case aeso_syntax:get_ann(file, Ann, no_file) of
|
||||||
no_file -> ok;
|
no_file -> ok;
|
||||||
File -> ets_insert(warnings, {unused_include, File, SrcFile})
|
File -> ets_insert(warnings, {unused_include, File, SrcFile})
|
||||||
|
end
|
||||||
end.
|
end.
|
||||||
|
|
||||||
used_include(Ann) ->
|
used_include(Ann) ->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user