<div dir="ltr">Awesome reply! Thanks, </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 14, 2020 at 1:53 PM Kostis Sagonas <<a href="mailto:kostis@cs.ntua.gr">kostis@cs.ntua.gr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 2/14/20 1:44 PM, Jesper Eskilson wrote:<br>
> Hi,<br>
> <br>
> When dialyzer analyzes this program:<br>
> <br>
> <br>
> -module(foo).<br>
> -export([main/0]).<br>
> -record(foo, {x :: integer()}).<br>
> main() -><br>
> [ #foo{x = 0},<br>
> #foo{x = false} ].<br>
> <br>
> <br>
> it says:<br>
> <br>
> foo.erl:7: Function main/0 has no local return<br>
> foo.erl:8: Cons will produce an improper list since its 2nd argument is<br>
> none()<br>
> foo.erl:9: Record construction<br>
> #foo{x :: false} violates the declared type of field x ::<br>
> integer()<br>
> <br>
> <br>
> It seems like dialyzer assumes that any cons with second argument not <br>
> being a list will produce an improper list, but shouldn't it treat <br>
> "none()" differently?<br>
> <br>
> Is this a bug in dialyzer, or a feature whose usefulness I am unable to <br>
> grasp?<br>
<br>
It's a dialyzer feature, which we have purposedly sneaked into the tool <br>
to discover all users who choose to stop reading all warnings that the <br>
tool spits out and are not experienced enough to realize that once they <br>
fix the real culprit, which may not be the first warning that that the <br>
tool produces, the other warnings will also disappear.<br>
<br>
Cheers,<br>
Kostis<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><p style="font-family:"Helvetica Neue",Helvetica,arial,sans-serif;font-size:9pt;line-height:1.25em;color:rgb(130,130,137);letter-spacing:0.1px;margin:0px 0px 1em;padding:0px 5px"><b>Jesper Eskilson</b><br><span style="display:inline">Senior Software Engineer</span><br><span>Kred Core</span><br><span style="font-size:9pt">+46-72-855-8421</span></p><p style="font-family:"Helvetica Neue",Helvetica,arial,sans-serif;font-size:9pt;line-height:1.25em;color:rgb(130,130,137);letter-spacing:0.1px;margin:0px 0px 1em;padding:0px 5px">Klarna Bank AB<span style="line-height:13.3333px"> (publ)</span><br>Sveavägen 46, 111 34 Stockholm<br>Tel: <a href="tel:+46812012000" style="color:rgb(130,130,137)" target="_blank">+46 8 120 120 00</a><br>Reg no: 556737-0431<br><a href="http://klarna.com/" style="color:rgb(235,111,147)" target="_blank">klarna.com</a></p><p style="font-family:"Klarna Sans",sans-serif;font-size:14px;line-height:1.4em;color:rgb(73,73,74);letter-spacing:0.1px;margin:1em 0px;padding:0px 5px"><img src="https://cdn.klarna.com/1.0/shared/image/generic/logo/sv_se/basic/logo_black.png?width=240" width="120" style="border: 0px; vertical-align: middle; max-width: 120px;"></p></div></div></div></div></div>