Skip to content

map_fetch_key result is representation dependant #15592

Description

@lukaszsamson

Existing issue

  • I have searched existing issues and could not find a duplicate.

Elixir and Erlang/OTP versions

Erlang/OTP 28 [erts-16.4.0.1] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit]

Interactive Elixir (1.21.0-dev)

Operating system

any

Current behavior

Let's create equal types t and t2 by identity t2 = cover \ (cover \ t) with cover = t u knife

Repro:

t = closed_map([a: term()])
knife = open_map([c: none()])

cover = opt_union(t, knife)
t2 = opt_difference(cover, opt_difference(cover, t))

equal?(t, t2) # true

map_fetch_key(t, :a) # {false, :term}, correct
map_fetch_key(t2, :a) # :badkey, wrong

t representation

%{map: {-97320740, :closed, [a: :term]}}

t2 representation

%{
  map: {2486087065, {-97320740, :closed, [a: :term]}, :bdd_top,
   {105403943, :open, [c: %{}]}, :bdd_bot}
}

Related to #15491

Expected behavior

Result should be the same regardless of representation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions