Skip to content

Commit

Permalink
Exclude from_core option from compile_info when compiling
Browse files Browse the repository at this point in the history
Closes #201
  • Loading branch information
josevalim authored and eproxus committed Jan 8, 2019
1 parent 79b6ea0 commit 992509b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/meck_code.erl
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,13 @@ load_binary(Name, Binary) ->

% parse transforms have already been applied to the abstract code in the
% module, and often are not always available when compiling the forms, so
% filter them out of the options
% filter them out of the options.
%
% Furthermore, since Erlang/OTP 20, a code may be compiled from core but
% still have abstract code, so we make sure to remove the from_core option
% as we always compile it as a form.
filter_options (Options) ->
case Options of
undefined -> [];
_ -> lists:filter(fun({parse_transform,_}) -> false; (_) -> true end, Options)
_ -> lists:filter(fun({parse_transform,_}) -> false; (from_core) -> false; (_) -> true end, Options)
end.

0 comments on commit 992509b

Please sign in to comment.