aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2016-01-18 10:10:20 +0100
committerBjörn-Egil Dahlberg <[email protected]>2016-01-18 10:10:20 +0100
commitd1db55be9f84331e2ac4ddf3a2c4e2a84a1c4f14 (patch)
tree060134ff66a31612c6cfb3e7fa277d64780fd607 /lib/compiler/src
parent5c41dbbbb2b1d57f672899f0b13fe0d71686ceb9 (diff)
parent427c9f4f7777dd00e0a03a42b9834a4d669305b6 (diff)
downloadotp-d1db55be9f84331e2ac4ddf3a2c4e2a84a1c4f14.tar.gz
otp-d1db55be9f84331e2ac4ddf3a2c4e2a84a1c4f14.tar.bz2
otp-d1db55be9f84331e2ac4ddf3a2c4e2a84a1c4f14.zip
Merge branch 'maint'
Diffstat (limited to 'lib/compiler/src')
-rw-r--r--lib/compiler/src/cerl.erl11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/compiler/src/cerl.erl b/lib/compiler/src/cerl.erl
index 010327b5e3..e7a2b8177a 100644
--- a/lib/compiler/src/cerl.erl
+++ b/lib/compiler/src/cerl.erl
@@ -1598,13 +1598,20 @@ is_c_map(#c_literal{val = V}) when is_map(V) ->
is_c_map(_) ->
false.
--spec map_es(c_map()) -> [c_map_pair()].
+-spec map_es(c_map() | c_literal()) -> [c_map_pair()].
+map_es(#c_literal{anno=As,val=M}) when is_map(M) ->
+ [ann_c_map_pair(As,
+ #c_literal{anno=As,val='assoc'},
+ #c_literal{anno=As,val=K},
+ #c_literal{anno=As,val=V}) || {K,V} <- maps:to_list(M)];
map_es(#c_map{es = Es}) ->
Es.
--spec map_arg(c_map()) -> c_map() | c_literal().
+-spec map_arg(c_map() | c_literal()) -> c_map() | c_literal().
+map_arg(#c_literal{anno=As,val=M}) when is_map(M) ->
+ #c_literal{anno=As,val=#{}};
map_arg(#c_map{arg=M}) ->
M.