From cc7a3c5896bc266bb97287dd4e31b696d8cf604f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Wed, 2 Apr 2014 17:00:43 +0200 Subject: compiler,stdlib: Fix Map literals as keys for Maps in patterns --- lib/compiler/test/map_SUITE.erl | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/compiler/test/map_SUITE.erl') diff --git a/lib/compiler/test/map_SUITE.erl b/lib/compiler/test/map_SUITE.erl index cc018e4305..403b7e8405 100644 --- a/lib/compiler/test/map_SUITE.erl +++ b/lib/compiler/test/map_SUITE.erl @@ -113,6 +113,10 @@ t_build_and_match_literals(Config) when is_list(Config) -> M = #{ map_1:=#{ map_2:=#{value_3 := third}, value_2:= second}, value_1:=first} = id(#{ map_1=>#{ map_2=>#{value_3 => third}, value_2=> second}, value_1=>first}), + %% map key + #{ #{} := 42 } = id(#{ #{} => 42 }), + #{ #{ "a" => 3 } := 42 } = id(#{ #{ "a" => 3} => 42 }), + %% nil key #{[]:=ok,1:=2} = id(#{[]=>ok,1=>2}), @@ -123,6 +127,7 @@ t_build_and_match_literals(Config) when is_list(Config) -> {'EXIT',{{badmatch,_},_}} = (catch (#{x:=3} = id(#{y=>3}))), {'EXIT',{{badmatch,_},_}} = (catch (#{x:=3} = id(#{x=>"three"}))), {'EXIT',{badarg,_}} = (catch id(#{<<0:258>> =>"three"})), + {'EXIT',{{badmatch,_},_}} = (catch (#{#{"a"=>42} := 3}=id(#{#{"a"=>3}=>42}))), ok. t_build_and_match_aliasing(Config) when is_list(Config) -> -- cgit v1.2.3