Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in map key pattern matching #12586

Closed
zachallaun opened this issue May 22, 2023 · 0 comments
Closed

Regression in map key pattern matching #12586

zachallaun opened this issue May 22, 2023 · 0 comments

Comments

@zachallaun
Copy link
Contributor

zachallaun commented May 22, 2023

Elixir and Erlang/OTP versions

Erlang/OTP 26 [erts-14.0] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit:ns]

Elixir 1.15.0-rc.0 (3cdb388) (compiled with Erlang/OTP 24)

Operating system

Ubuntu-20.04

Current behavior

On 1.15.0-rc.0 on both OTP 25 and 26:

iex(1)> %{<<0>> => nil} = %{<<0>> => nil}
error: cannot use variable integer as map key inside a pattern. Map keys in patterns can only be literals (such as atoms, strings, tuples, and the like) or an existing variable matched with the pin operator (such as ^some_var)
  iex:1

** (CompileError) cannot compile code (errors have been logged)

Expected behavior

On 1.14.4:

iex(1)> %{<<0>> => nil} = %{<<0>> => nil}
%{<<0>> => nil}

Found courtesy of stream_data 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant