<html><head></head><body>When a tool does something incorrect, and I think everybody agree that first and second warnings are incorrect, those are called bugs, not features.<br><br>And when something incorrect is purposefully sneaked in, then one may ask a question what else undesirable may be purposefully added. It could be a routine sending private code to professional human code review to ensure the high quality and absence of bugs.<br><br><div class="gmail_quote">On 14 February 2020 11:53:23 pm AEDT, Kostis Sagonas <kostis@cs.ntua.gr> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">On 2/14/20 1:44 PM, Jesper Eskilson wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">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></blockquote><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></pre></blockquote></div><br>-- <br>Kind regards,<br>Dmitry Belyaev</body></html>