[erlang-questions] Dialyzer and numeric range values

Fred Hebert mononcqc@REDACTED
Wed Nov 1 12:27:35 CET 2017


On 11/01, zxq9 wrote:
>What is going on here? Is this a new thing with R20's Dialyzer, or have 
>I just never noticed these multi-byte leaps in value range resolution?
>

You never noticed it. Dialyzer kind of keeps the right to expand ranges 
arbitrarily. You can see in the source code that anything set of types 
above 12 gets merged into one:
https://github.com/erlang/otp/blob/fe1df7fc6bf050cb6c9bbd99eb9393c426b62f67/lib/hipe/cerl/erl_types.erl#L1997-L2011

The same kind of stuff also happens with atoms or even types in general 
(https://github.com/erlang/otp/blob/fe1df7fc6bf050cb6c9bbd99eb9393c426b62f67/lib/hipe/cerl/erl_types.erl#L4860-L4866) 
which can be merged into the any() type.

It's frankly a bit of a bummer but I figure it's something Dialyzer does 
to be less memory-hungry, at the cost of accuracy.



More information about the erlang-questions mailing list