Mark only included files as potentially unused #933

Merged
ghallak merged 3 commits from ghallak/441 into master 2023-03-21 19:55:19 +09:00
Showing only changes of commit 45d0c5996a - Show all commits

View File

@ -3207,9 +3207,14 @@ when_warning(Warn, Do) ->
%% Warnings (Unused includes)
potential_unused_include(Ann, SrcFile) ->
case aeso_syntax:get_ann(file, Ann, no_file) of
no_file -> ok;
File -> ets_insert(warnings, {unused_include, File, 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
no_file -> ok;
File -> ets_insert(warnings, {unused_include, File, SrcFile})
end
end.
used_include(Ann) ->