aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2014-04-02 18:57:49 +0200
committerBjörn-Egil Dahlberg <[email protected]>2014-04-03 14:32:44 +0200
commit7b11f5a2608ea2a539454fe8f14e4d24d3a0170f (patch)
tree93b1241ff35ea624e6a282f67fa4521a35292f05 /lib/stdlib/test
parentc655521ab142547c371df3470a3fc62beef048ae (diff)
downloadotp-7b11f5a2608ea2a539454fe8f14e4d24d3a0170f.tar.gz
otp-7b11f5a2608ea2a539454fe8f14e4d24d3a0170f.tar.bz2
otp-7b11f5a2608ea2a539454fe8f14e4d24d3a0170f.zip
stdlib: Deny map keys defined as #{ .. := .. } in patterns
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r--lib/stdlib/test/erl_lint_SUITE.erl14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/stdlib/test/erl_lint_SUITE.erl b/lib/stdlib/test/erl_lint_SUITE.erl
index bb14de333d..d9512c0ef4 100644
--- a/lib/stdlib/test/erl_lint_SUITE.erl
+++ b/lib/stdlib/test/erl_lint_SUITE.erl
@@ -3406,7 +3406,19 @@ maps(Config) ->
{4,erl_lint,illegal_map_key},
{6,erl_lint,illegal_map_key},
{8,erl_lint,illegal_map_key},
- {10,erl_lint,illegal_map_key}],[]}}],
+ {10,erl_lint,illegal_map_key}],[]}},
+ {errors_in_map_keys_pattern,
+ <<"t(#{ a := 2,
+ #{} := A,
+ #{ 3 => 33 } := hi,
+ #{ 3 := 33 } := hi,
+ #{ hi => 54, \"hello\" => 45 } := hi,
+ #{ V => 33 } := hi }) ->
+ A.
+ ">>,
+ [],
+ {errors,[{4,erl_lint,illegal_map_key},
+ {6,erl_lint,{illegal_map_key_variable,'V'}}],[]}}],
[] = run(Config, Ts),
ok.