aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2018-06-29 14:30:24 +0200
committerErlang/OTP <[email protected]>2018-06-29 14:30:24 +0200
commit7ea24a343e003c74004a6d82e36ffbb50997f60a (patch)
treebba74280f5c4bc69a4ad3f4edda554b90129b74e /lib/compiler/test
parentb2aa37d72997df921e935380a77b0e0226f33401 (diff)
parentc221bb38a80f8c3c4263ebdd609ff8ae6e5d117f (diff)
downloadotp-7ea24a343e003c74004a6d82e36ffbb50997f60a.tar.gz
otp-7ea24a343e003c74004a6d82e36ffbb50997f60a.tar.bz2
otp-7ea24a343e003c74004a6d82e36ffbb50997f60a.zip
Merge branch 'bjorn/compiler/fix-map_get/OTP-15157' into maint-21
* bjorn/compiler/fix-map_get/OTP-15157: Fix internal compiler error for map_get/2
Diffstat (limited to 'lib/compiler/test')
-rw-r--r--lib/compiler/test/map_SUITE.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/compiler/test/map_SUITE.erl b/lib/compiler/test/map_SUITE.erl
index 6badc7a8b8..494faf299b 100644
--- a/lib/compiler/test/map_SUITE.erl
+++ b/lib/compiler/test/map_SUITE.erl
@@ -706,6 +706,12 @@ t_map_get(Config) when is_list(Config) ->
{'EXIT',{{badmap,[]},_}} = (catch map_get(a, [])),
{'EXIT',{{badmap,<<1,2,3>>},_}} = (catch map_get(a, <<1,2,3>>)),
{'EXIT',{{badmap,1},_}} = (catch map_get(a, 1)),
+
+ %% Test that beam_validator understands that NewMap is
+ %% a map after seeing map_get(a, NewMap).
+ NewMap = id(#{a=>b}),
+ b = map_get(a, NewMap),
+ #{a:=z} = NewMap#{a:=z},
ok.
check_map_value(Map, Key, Value) when map_get(Key, Map) =:= Value -> true;