From 9f48a7e7d39c3aa7266a9f9a1db07accbb185a67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20H=C3=B6gberg?= Date: Tue, 26 Feb 2019 16:21:48 +0100 Subject: beam_validator: Handle is_number, and join(float,int) -> number I have no idea how this escaped us for so long... --- lib/compiler/src/beam_validator.erl | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/compiler') 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) -> -- cgit v1.2.3