Skip to content

Commit

Permalink
Support OTP 23
Browse files Browse the repository at this point in the history
  • Loading branch information
eproxus committed Jun 8, 2022
1 parent e9f663e commit de9956b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rebar.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{erl_opts, [debug_info]}.
{deps, []}.

{erl_opts, [
debug_info,
{platform_define, "^24", 'OTP_24_AND_LATER'}
]}.

{project_plugins, [erlfmt]}.

{erlfmt, [
Expand Down
5 changes: 5 additions & 0 deletions src/mapz.erl
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,13 @@ badvalue_and_badkey(P, _Rest, error) -> error({badkey, P}).
badvalue_and_create(P, _Rest, {ok, _Existing}, _Init) -> error({badvalue, P});
badvalue_and_create(_P, Rest, error, Init) -> create(Rest, Init).

-ifdef(OTP_24_AND_LATER).
error_info(Reason, Args) ->
erlang:error(Reason, Args, [{error_info, #{module => ?MODULE}}]).
-else.
error_info(Reason, Args) ->
erlang:error(Reason, Args).
-endif.

error_args(iterator, [_Map]) ->
#{1 => <<"not a map">>};
Expand Down

0 comments on commit de9956b

Please sign in to comment.