diff options
author | John Högberg <[email protected]> | 2019-03-04 15:17:54 +0100 |
---|---|---|
committer | John Högberg <[email protected]> | 2019-03-05 15:41:20 +0100 |
commit | 6a0de46369e72d06477681a50bc325e556069029 (patch) | |
tree | 0db8284f72eabd80893171730efde1a41079b2e8 /lib/compiler/src | |
parent | 1cac7619bf9892f571f855a424b5542c3c1aaf81 (diff) | |
download | otp-6a0de46369e72d06477681a50bc325e556069029.tar.gz otp-6a0de46369e72d06477681a50bc325e556069029.tar.bz2 otp-6a0de46369e72d06477681a50bc325e556069029.zip |
beam_validator: is_map no longer needs special treatment
Diffstat (limited to 'lib/compiler/src')
-rw-r--r-- | lib/compiler/src/beam_validator.erl | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/compiler/src/beam_validator.erl b/lib/compiler/src/beam_validator.erl index 139eee95ba..e50cc3696f 100644 --- a/lib/compiler/src/beam_validator.erl +++ b/lib/compiler/src/beam_validator.erl @@ -897,6 +897,8 @@ 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_map,{f,Lbl},[Src]}, Vst) -> + type_test(Lbl, map, Src, Vst); valfun_4({test,is_nil,{f,Lbl},[Src]}, Vst) -> %% is_nil is an exact check against the 'nil' value, and should not be %% treated as a simple type test. @@ -908,16 +910,6 @@ valfun_4({test,is_nil,{f,Lbl},[Src]}, Vst) -> fun(SuccVst) -> update_eq_types(Src, nil, SuccVst) end); -valfun_4({test,is_map,{f,Lbl},[Src]}, Vst) -> - case Src of - {Tag,_} when Tag =:= x; Tag =:= y -> - type_test(Lbl, map, Src, Vst); - {literal,Map} when is_map(Map) -> - Vst; - _ -> - assert_term(Src, Vst), - kill_state(Vst) - end; valfun_4({test,test_arity,{f,Lbl},[Tuple,Sz]}, Vst) when is_integer(Sz) -> assert_type(tuple, Tuple, Vst), branch(Lbl, Vst, |