aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2014-03-06 15:06:43 +0100
committerBjörn-Egil Dahlberg <[email protected]>2014-03-06 15:06:43 +0100
commit35e8ea1c100248acc037205b0d551f6ee0b9f773 (patch)
treec6ab8e187fc17bc5c275aecf655a85dbdf5eb4aa /lib/compiler/src
parent24c1ee0228ff442dafa5c2e87661ba2d2f97bf2f (diff)
parent2b5acdb32471f2eb469221007fc70dc24db271b6 (diff)
downloadotp-35e8ea1c100248acc037205b0d551f6ee0b9f773.tar.gz
otp-35e8ea1c100248acc037205b0d551f6ee0b9f773.tar.bz2
otp-35e8ea1c100248acc037205b0d551f6ee0b9f773.zip
Merge branch 'nox/maps-cerl_clauses'
* nox/maps-cerl_clauses: Support maps in cerl_clauses:match/2
Diffstat (limited to 'lib/compiler/src')
-rw-r--r--lib/compiler/src/cerl_clauses.erl18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/compiler/src/cerl_clauses.erl b/lib/compiler/src/cerl_clauses.erl
index 99fa8dd9d5..76d70dcabf 100644
--- a/lib/compiler/src/cerl_clauses.erl
+++ b/lib/compiler/src/cerl_clauses.erl
@@ -354,6 +354,24 @@ match(P, E, Bs) ->
{false, Bs}
end
end;
+ map ->
+ %% The most we can do is to say "definitely no match" if a
+ %% binary pattern is matched against non-binary data.
+ case E of
+ any ->
+ {false, Bs};
+ _ ->
+ case type(E) of
+ literal ->
+ none;
+ cons ->
+ none;
+ tuple ->
+ none;
+ _ ->
+ {false, Bs}
+ end
+ end;
_ ->
match_1(P, E, Bs)
end.