Skip to content

Commit 4096b31

Browse files
author
José Valim
committed
Ensure the proper scope is passed on args call, closes #949
1 parent 49a5b8f commit 4096b31

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/elixir/src/elixir_translator.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ no_alias_expansion(Other) ->
589589

590590
translate_arg(Arg, { Acc, S }) ->
591591
{ TArg, TAcc } = translate_each(Arg, Acc),
592-
{ TArg, { umergec(S, TAcc), umergev(S, TAcc) } }.
592+
{ TArg, { umergec(Acc, TAcc), umergev(S, TAcc) } }.
593593

594594
translate_args(Args, #elixir_scope{context=match} = S) ->
595595
translate(Args, S);

lib/elixir/test/erlang/conditionals_test.erl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@ andand_test() ->
234234
end,
235235
test_helper:run_and_remove(F, ['Elixir.Bar']).
236236

237+
andand_with_literal_test() ->
238+
{[nil, nil, nil], _} = eval("[nil && 2, nil && 3, nil && 4]").
239+
237240
oror_test() ->
238241
F = fun() ->
239242
eval("defmodule Bar do\ndef foo, do: true\ndef bar, do: false\n def baz(x), do: x == 1\nend"),

0 commit comments

Comments
 (0)