Skip to content

Commit

Permalink
fix invalid expansion of Enum.fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszsamson committed Nov 19, 2023
1 parent e8abc40 commit 16d28f7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/elixir_sense/core/binding.ex
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ defmodule ElixirSense.Core.Binding do
case expand(env, list_candidate, stack) do
{:list, type} ->
if name == :fetch do
{:tuple, 2, {{:atom, :ok}, type}}
{:tuple, 2, [{:atom, :ok}, type]}
else
type
end
Expand Down
2 changes: 1 addition & 1 deletion test/elixir_sense/core/binding_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -1779,7 +1779,7 @@ defmodule ElixirSense.Core.BindingTest do
end

test "fetch" do
assert {:tuple, 2, {{:atom, :ok}, {:atom, :a}}} =
assert {:tuple, 2, [{:atom, :ok}, {:atom, :a}]} =
Binding.expand(
@env,
{:call, {:atom, Enum}, :fetch, [{:list, {:atom, :a}}, nil]}
Expand Down

0 comments on commit 16d28f7

Please sign in to comment.