You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[erl-frontend] Be less restrictive on map pattern keys
Summary:
[This document](https://www.erlang.org/doc/apps/erts/absform.html#patterns) says
> If P is a map pattern #{A_1, ..., A_k}, where each A_i is an association P_i_1 := P_i_2,
which implied to us that both keys and values have to be patterns themselves.
But [this other document](https://www.erlang.org/doc/reference_manual/expressions.html#maps-in-patterns) says
> The key K must be a guard expression, with all variables already bound. V can be any pattern with either bound or unbound variables.
and seems like the compiler also implements the latter. So adjusting our validation.
Reviewed By: mmarescotti
Differential Revision: D42191306
fbshipit-source-id: 6d5d96c51380719916a10f11c2a511b176afa2a4
0 commit comments