diff options
author | Björn Gustavsson <[email protected]> | 2018-09-11 06:33:43 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2018-09-17 06:41:02 +0200 |
commit | 6de7b652697ecdb17a003e64418ab297c9111faa (patch) | |
tree | e6b55247f5e8b7fdc3b5474913c97a47900239a9 /lib/compiler/src | |
parent | 25005204cca654920c7a751bb3ada4b9d9b0b285 (diff) | |
download | otp-6de7b652697ecdb17a003e64418ab297c9111faa.tar.gz otp-6de7b652697ecdb17a003e64418ab297c9111faa.tar.bz2 otp-6de7b652697ecdb17a003e64418ab297c9111faa.zip |
beam_ssa_type: Remove clause in arith_op_types/2 that can't match
Remove the following clause from the `fun` clauses in arith_op_types/2
because it cannot possibly match:
(_, any) -> number;
Here is why it cannot match:
The second argument is the accumulator for lists:foldl/3.
Its initial value is `unknown`.
None of the clauses will update the accumulator to `any`, including
the clause that matches `any` in the first argument -- it will set the
accumulator to `number`.
Thus, the accumulator (second argument) can never be `any` and
the clause can never match. QED.
Diffstat (limited to 'lib/compiler/src')
-rw-r--r-- | lib/compiler/src/beam_ssa_type.erl | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/lib/compiler/src/beam_ssa_type.erl b/lib/compiler/src/beam_ssa_type.erl index 2ba0f732f6..7ef64c0c4d 100644 --- a/lib/compiler/src/beam_ssa_type.erl +++ b/lib/compiler/src/beam_ssa_type.erl @@ -491,7 +491,6 @@ arith_op_type(Args, Ts) -> (number, #t_integer{}) -> number; (number, float) -> float; (any, _) -> number; - (_, any) -> number; (Same, Same) -> Same; (_, _) -> none end, unknown, Types). |