Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/elixir/lib/module/types/descr.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3139,7 +3139,7 @@ defmodule Module.Types.Descr do
end

defp map_fetch_key_static(%{map: bdd}, key) do
bdd |> map_bdd_to_dnf_with_empty() |> map_dnf_fetch_static(key)
bdd |> map_bdd_to_dnf_remove_empty() |> map_dnf_fetch_static(key)
end

defp map_fetch_key_static(%{}, _key), do: {false, none()}
Expand Down
8 changes: 8 additions & 0 deletions lib/elixir/test/elixir/module/types/descr_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2458,6 +2458,14 @@ defmodule Module.Types.DescrTest do
|> opt_difference(open_map(a: atom([:foo, :bar])))
|> opt_difference(open_map(a: atom([:foo, :baz])))
|> map_fetch_key(:a) == {false, integer()}

t = closed_map(a: term())
knife = open_map(c: none())
cover = opt_union(t, knife)
t2 = opt_difference(cover, opt_difference(cover, t))
assert equal?(t, t2)
assert map_fetch_key(t, :a) == {false, term()}
assert map_fetch_key(t2, :a) == map_fetch_key(t, :a)
end

# Times out without a projection-only map_fetch_key path
Expand Down