Skip to content

Commit

Permalink
Wrap the -no_underspecs in a preprocessor check
Browse files Browse the repository at this point in the history
This is intended as a (temporary) service to make code
generated code on Erlang 24 compile also on earlier systems,
while dialyzing well on Erlang 24.
  • Loading branch information
tomas-abrahamsson committed Dec 5, 2021
1 parent c9e454d commit 10a8899
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gpb_lib.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,9 @@ no_underspecs_dialyzer_attr(FnName, Arity, Opts) ->
%% option.
case can_do_no_underspecs_dialyzer_attr(Opts) of
true ->
?f("-dialyzer({no_underspecs, ~p/~w}).~n", [FnName, Arity]);
[?f("-if(?OTP_RELEASE >= 24).~n"), % easy-support of slightly older
?f("-dialyzer({no_underspecs, ~p/~w}).~n", [FnName, Arity]),
?f("-endif.~n")];
false ->
""
end.
Expand Down

0 comments on commit 10a8899

Please sign in to comment.