Skip to content

Commit bbe04b4

Browse files
committed
Address compilation on Erlang/OTP 24
1 parent 9153d73 commit bbe04b4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/elixir/src/elixir.erl

+6-6
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ eval_forms(Tree, Binding, OrigE, Opts) ->
358358
_ -> [Erl]
359359
end,
360360

361-
ExternalHandler = {value, fun ?MODULE:eval_external_handler/3},
361+
ExternalHandler = eval_external_handler(),
362362

363363
{value, Value, NewBinding} =
364364
try
@@ -387,6 +387,9 @@ eval_forms(Tree, Binding, OrigE, Opts) ->
387387

388388
%% TODO: Remove conditional once we require Erlang/OTP 25+.
389389
-if(?OTP_RELEASE >= 25).
390+
eval_external_handler() ->
391+
{value, fun ?MODULE:eval_external_handler/3}.
392+
390393
eval_external_handler(Ann, FunOrModFun, Args) ->
391394
try
392395
case FunOrModFun of
@@ -450,11 +453,8 @@ drop_common([], [{?MODULE, _, _, _} | T2], _ToDrop) -> T2;
450453
drop_common([], [_ | T2], true) -> T2;
451454
drop_common([], T2, _) -> T2.
452455
-else.
453-
eval_external_handler(_Ann, FunOrModFun, Args) ->
454-
case FunOrModFun of
455-
{Mod, Fun} -> apply(Mod, Fun, Args);
456-
Fun -> apply(Fun, Args)
457-
end.
456+
eval_external_handler() -> none.
457+
eval_external_handler(_Ann, _FunOrModFun, _Args) -> error(unused).
458458
-endif.
459459

460460
%% Converts a quoted expression to Erlang abstract format

0 commit comments

Comments
 (0)