aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-02-02 13:01:10 +0100
committerBjörn Gustavsson <[email protected]>2015-02-03 07:34:17 +0100
commit94b36c7c2534f92e1d1ce768fb63d9012bb0c630 (patch)
tree824fc247e6049575a2a0324a1a985d2432d57bde /lib/compiler/test
parentd9ed708bb5d22cf61029eac0a23b9d3dc94a5146 (diff)
downloadotp-94b36c7c2534f92e1d1ce768fb63d9012bb0c630.tar.gz
otp-94b36c7c2534f92e1d1ce768fb63d9012bb0c630.tar.bz2
otp-94b36c7c2534f92e1d1ce768fb63d9012bb0c630.zip
Be more careful about map patterns when evalutating element/2
We must not convert map patterns to map expressions.
Diffstat (limited to 'lib/compiler/test')
-rw-r--r--lib/compiler/test/core_fold_SUITE.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/compiler/test/core_fold_SUITE.erl b/lib/compiler/test/core_fold_SUITE.erl
index 6a7036d728..9c7e97a1bf 100644
--- a/lib/compiler/test/core_fold_SUITE.erl
+++ b/lib/compiler/test/core_fold_SUITE.erl
@@ -60,6 +60,12 @@ t_element(Config) when is_list(Config) ->
X = make_ref(),
?line X = id(element(1, {X,y,z})),
?line b = id(element(2, {a,b,c,d})),
+ (fun() ->
+ case {a,#{k=>X}} of
+ {a,#{k:=X}}=Tuple ->
+ #{k:=X} = id(element(2, Tuple))
+ end
+ end)(),
%% No optimization, but should work.
Tuple = id({x,y,z}),