diff options
author | Björn-Egil Dahlberg <[email protected]> | 2013-09-17 16:50:05 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2014-01-28 15:56:25 +0100 |
commit | 08a9a9a7113d310de2e6511d898a06cb8a559ce8 (patch) | |
tree | 6260885fdc38c40273564ef8b006a9b6e12f2776 /lib/compiler/src/sys_pre_expand.erl | |
parent | 2a943f14a44903eb8e67549978de5dbf7275ad57 (diff) | |
download | otp-08a9a9a7113d310de2e6511d898a06cb8a559ce8.tar.gz otp-08a9a9a7113d310de2e6511d898a06cb8a559ce8.tar.bz2 otp-08a9a9a7113d310de2e6511d898a06cb8a559ce8.zip |
compiler: Handle literals, not just atoms, as keys in maps
Diffstat (limited to 'lib/compiler/src/sys_pre_expand.erl')
-rw-r--r-- | lib/compiler/src/sys_pre_expand.erl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/compiler/src/sys_pre_expand.erl b/lib/compiler/src/sys_pre_expand.erl index 969e95e8dc..04084d22ff 100644 --- a/lib/compiler/src/sys_pre_expand.erl +++ b/lib/compiler/src/sys_pre_expand.erl @@ -231,9 +231,10 @@ pattern({tuple,Line,Ps}, St0) -> pattern({map,Line,Ps}, St0) -> {TPs,St1} = pattern_list(Ps, St0), {{map,Line,TPs},St1}; -pattern({map_field,Line,Key,V0}, St0) -> - {V,St1} = pattern(V0, St0), - {{map_field,Line,Key,V},St1}; +pattern({map_field,Line,K0,V0}, St0) -> + {K,St1} = pattern(K0, St0), + {V,St2} = pattern(V0, St1), + {{map_field,Line,K,V},St2}; %%pattern({struct,Line,Tag,Ps}, St0) -> %% {TPs,TPsvs,St1} = pattern_list(Ps, St0), %% {{tuple,Line,[{atom,Line,Tag}|TPs]},TPsvs,St1}; |