aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test/map_SUITE_data/badmap_17.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-04-16 14:29:11 +0200
committerBjörn Gustavsson <[email protected]>2015-04-16 14:29:11 +0200
commit74e17586f417a595d8d6d2fac06e3c4cfd2a7812 (patch)
treef3edfcb3b27e89c9cabe0b86b7847bf66eed5d61 /erts/emulator/test/map_SUITE_data/badmap_17.erl
parent82670b1f264f14d6dd2502efe459d9478826a788 (diff)
parent5a19f97ebb036f7e9f6e2c735d9f52662b20a6a2 (diff)
downloadotp-74e17586f417a595d8d6d2fac06e3c4cfd2a7812.tar.gz
otp-74e17586f417a595d8d6d2fac06e3c4cfd2a7812.tar.bz2
otp-74e17586f417a595d8d6d2fac06e3c4cfd2a7812.zip
Merge branch 'bjorn/maps'
* bjorn/maps: Document the new {badmap,Term} and {badkey,Key} exceptions Raise more descriptive error messages for failed map operations erl_term.h: Add is_not_map() macro Tigthen code for the i_get_map_elements/3 instruction Pre-compute hash values for the general get_map_elements instruction Teach the loader to pre-compute the hash value for single-key lookups Optimize use of i_get_map_element/4 beam_emu: Slightly optimize update_map_{assoc,exact} v3_codegen: Don't sort map keys in map creation/update beam_validator: No longer require strict literal term order Sort maps keys in the loader De-optimize the has_map_fields instructions erts/map_SUITE.erl: Add a test case that tests has_map_fields Fully evaluate is_map/1 for literals at load-time map_SUITE: Add tests of is_map/1 with literal maps Run a clone of map_SUITE without optimizations Remove the fail label operand of the new_map instruction Correct transformation of put_map_assoc to new_map Remove support for put_map_exact without a source map
Diffstat (limited to 'erts/emulator/test/map_SUITE_data/badmap_17.erl')
-rw-r--r--erts/emulator/test/map_SUITE_data/badmap_17.erl26
1 files changed, 26 insertions, 0 deletions
diff --git a/erts/emulator/test/map_SUITE_data/badmap_17.erl b/erts/emulator/test/map_SUITE_data/badmap_17.erl
new file mode 100644
index 0000000000..0ec65e0e33
--- /dev/null
+++ b/erts/emulator/test/map_SUITE_data/badmap_17.erl
@@ -0,0 +1,26 @@
+-module(badmap_17).
+-export([update/1]).
+
+%% Compile this source file with OTP 17.
+
+update(Map) ->
+ try
+ update_1(Map),
+ error(update_did_not_fail)
+ catch
+ error:{badmap,Map} ->
+ ok
+ end,
+ try
+ update_2(Map),
+ error(update_did_not_fail)
+ catch
+ error:{badmap,Map} ->
+ ok
+ end.
+
+update_1(M) ->
+ M#{a=>42}.
+
+update_2(M) ->
+ M#{a:=42}.