aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2019-02-26 16:21:48 +0100
committerJohn Högberg <[email protected]>2019-02-27 11:57:24 +0100
commit9f48a7e7d39c3aa7266a9f9a1db07accbb185a67 (patch)
treeec32ee516cbfd10b245ec23dcd9eb5420c353d4b /lib
parent1193acf4bdc1435790756e4dab1cdd91657abf94 (diff)
downloadotp-9f48a7e7d39c3aa7266a9f9a1db07accbb185a67.tar.gz
otp-9f48a7e7d39c3aa7266a9f9a1db07accbb185a67.tar.bz2
otp-9f48a7e7d39c3aa7266a9f9a1db07accbb185a67.zip
beam_validator: Handle is_number, and join(float,int) -> number
I have no idea how this escaped us for so long...
Diffstat (limited to 'lib')
-rw-r--r--lib/compiler/src/beam_validator.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/compiler/src/beam_validator.erl b/lib/compiler/src/beam_validator.erl
index f848b4de8d..b70cd30a33 100644
--- a/lib/compiler/src/beam_validator.erl
+++ b/lib/compiler/src/beam_validator.erl
@@ -776,6 +776,8 @@ valfun_4({test,is_integer,{f,Lbl},[Src]}, Vst) ->
type_test(Lbl, {integer,[]}, Src, Vst);
valfun_4({test,is_nonempty_list,{f,Lbl},[Src]}, Vst) ->
type_test(Lbl, cons, Src, Vst);
+valfun_4({test,is_number,{f,Lbl},[Src]}, Vst) ->
+ type_test(Lbl, number, Src, Vst);
valfun_4({test,is_list,{f,Lbl},[Src]}, Vst) ->
type_test(Lbl, list, Src, Vst);
valfun_4({test,is_nil,{f,Lbl},[Src]}, Vst) ->
@@ -2139,6 +2141,10 @@ join({Type,_}, number)
join(number, {Type,_})
when Type =:= integer; Type =:= float ->
number;
+join({integer,_}, {float,_}) ->
+ number;
+join({float,_}, {integer,_}) ->
+ number;
join(bool, {atom,A}) ->
join_bool(A);
join({atom,A}, bool) ->