aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-05-19 10:09:18 +0200
committerBjörn Gustavsson <[email protected]>2016-05-20 10:07:17 +0200
commit6515f262cba9325bef84ce90758f2e74ebfb8c9e (patch)
tree2601486ea4655ae2534892a4ad3bb03827b8bced /lib
parentaa30fb09bca19916c82c239ce4d21897897a1b03 (diff)
downloadotp-6515f262cba9325bef84ce90758f2e74ebfb8c9e.tar.gz
otp-6515f262cba9325bef84ce90758f2e74ebfb8c9e.tar.bz2
otp-6515f262cba9325bef84ce90758f2e74ebfb8c9e.zip
beam_validator: Handle cons literals better
As a preparation for better optimizations in beam_type, a list literal must be accepted as a 'cons'.
Diffstat (limited to 'lib')
-rw-r--r--lib/compiler/src/beam_validator.erl2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/compiler/src/beam_validator.erl b/lib/compiler/src/beam_validator.erl
index d53aff004f..faff9940ec 100644
--- a/lib/compiler/src/beam_validator.erl
+++ b/lib/compiler/src/beam_validator.erl
@@ -1174,6 +1174,8 @@ assert_type({tuple_element,I}, {tuple,Sz})
ok;
assert_type({tuple_element,I}, {literal,Lit}) when I =< tuple_size(Lit) ->
ok;
+assert_type(cons, {literal,[_|_]}) ->
+ ok;
assert_type(Needed, Actual) ->
error({bad_type,{needed,Needed},{actual,Actual}}).