Skip to content

Commit

Permalink
relaxing types in erl_parse and erl_syntax
Browse files Browse the repository at this point in the history
Summary:
- erl_parse and erl_syntax are inconsistent about types - this results in a bunch of ignores in our code
- making offenders `dynamic()` to reduce the noise
- eliminates 20 ignores

Reviewed By: kren1

Differential Revision: D68490666

fbshipit-source-id: 4c2e0d079751c94447e149bc6a306398ac53bd53
  • Loading branch information
ilya-klyuchnikov authored and facebook-github-bot committed Jan 22, 2025
1 parent 70e758e commit ab2a2c9
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions finer_taint/src/finer_taint_compiler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ instrument_with_sinks(Forms, Options) ->
get_source([]) ->
error(taint_unknown_module);
get_source([{attribute, _, file, {Source, _}} | _]) ->
% eqwalizer:ignore - This should be cast_dynamic, but can't import eqwalizer module here because parse transform
Source;
get_source([_ | Rest]) ->
get_source(Rest).
Expand All @@ -202,7 +201,6 @@ get_module([_ | Rest]) -> get_module(Rest).

-spec has_ms_transform(forms()) -> boolean().
has_ms_transform([{attribute, _, file, {Path, _Line}} | Tail]) ->
% eqwalizer:ignore - assume `Path :: unicode:chardata()`
case string:find(Path, "ms_transform.hrl") of
nomatch -> has_ms_transform(Tail);
_ -> true
Expand All @@ -223,7 +221,6 @@ rewrite(Rest = [{attribute, _, finer_taint_compiled, _} | _], _, Acc) ->
rewrite([], _, Acc) ->
%% all input has been processed
Forms = lists:reverse(Acc),
% eqwalizer:ignore This should be cast_dynamic, but can't import eqwalizer module here because parse transform
[
erl_parse:map_anno(fun(Anno) -> erl_anno:set_generated(true, Anno) end, Form)
|| Form <- Forms
Expand Down Expand Up @@ -1130,7 +1127,6 @@ compile_forms(Forms) ->
-spec load_forms(binary()) -> {module(), forms()}.
load_forms(Binary) ->
{ok, {Module, [{abstract_code, {_, Forms}} | _]}} = beam_lib:chunks(Binary, [abstract_code, compile_info]),
% eqwalizer:ignore optimistic use of beam_lib API
{Module, Forms}.

-spec ms_transform(forms(), options()) -> forms().
Expand Down

0 comments on commit ab2a2c9

Please sign in to comment.