diff options
author | Björn Gustavsson <[email protected]> | 2018-04-19 14:07:42 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2018-04-19 14:07:42 +0200 |
commit | 0e831fff602e9c13471d4833a0e78c94020a86b6 (patch) | |
tree | 93cd824883e57a416e3d02e78b07ceaf48ca3f74 /lib/compiler/test/map_SUITE.erl | |
parent | 060d1982d93b83c142e594a88433c4cf80032533 (diff) | |
parent | 6626b2a4ac67631bef3144bf9eca41b5f49c3176 (diff) | |
download | otp-0e831fff602e9c13471d4833a0e78c94020a86b6.tar.gz otp-0e831fff602e9c13471d4833a0e78c94020a86b6.tar.bz2 otp-0e831fff602e9c13471d4833a0e78c94020a86b6.zip |
Merge branch 'bjorn/compiler/core_lint'
* bjorn/compiler/core_lint:
core_lint: Handle repeated variables in map patterns correctly
Diffstat (limited to 'lib/compiler/test/map_SUITE.erl')
-rw-r--r-- | lib/compiler/test/map_SUITE.erl | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/compiler/test/map_SUITE.erl b/lib/compiler/test/map_SUITE.erl index f15917e3cb..3146c31c21 100644 --- a/lib/compiler/test/map_SUITE.erl +++ b/lib/compiler/test/map_SUITE.erl @@ -67,8 +67,10 @@ %% errors in 18 t_register_corruption/1, - t_bad_update/1 + t_bad_update/1, + %% new in OTP 21 + t_reused_key_variable/1 ]). suite() -> []. @@ -120,7 +122,10 @@ all() -> %% errors in 18 t_register_corruption, - t_bad_update + t_bad_update, + + %% new in OTP 21 + t_reused_key_variable ]. groups() -> []. @@ -1980,6 +1985,16 @@ properly(Item) -> increase(Allows) -> catch fun() -> Allows end#{[] => +Allows, "warranty" => fun id/1}. +t_reused_key_variable(Config) when is_list(Config) -> + Key = id(key), + Map1 = id(#{Key=>Config}), + Map2 = id(#{Key=>Config}), + case {Map1,Map2} of + %% core_lint treated Key as pattern variables, not input variables, + %% and complained about the variable being duplicated. + {#{Key:=Same},#{Key:=Same}} -> + ok + end. %% aux |