Skip to content

map_get/2 wrongly computed on BDD with difference #15330

@gldubc

Description

@gldubc

Elixir and Erlang/OTP versions

Elixir 1.20.0-rc.4 (89e0106) (compiled with Erlang/OTP 28)

Operating system

MacOS

Current behavior

Issue with how map_get is computed when there are negations. Repro:

base = open_map([{domain_key(:atom), term()}])
bad = open_map(a: if_set(negation(integer())))
map = negation(union(negation(base), bad))

assert equal?(map, open_map(a: integer()))

{:ok, type} = map_get(map, atom())
assert equal?(type, term())
# currently returns integer()

{:ok, type} = map_get(map, atom([:a]))
assert equal?(type, term())
# currently errors

Expected behavior

Since map is equivalent to open_map(a: integer()), lookup by atom() should return term(), and lookup by :a should return integer().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions