<div dir="ltr"><div dir="ltr"><div>Hi, Fernando,</div><div><br></div><div>Thank you for your reply. I tried enabling other warnings as well, but the result was the same:</div><div><span style="font-family:monospace"><span style="color:rgb(178,104,24);background-color:rgb(255,255,255)"> </span>rebar.config</span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><span style="font-family:monospace"><span style="font-family:monospace"><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">{erl_opts, [debug_info]}.
</span><br>{deps, []}.<br></span>{dialyzer, [{warnings, [error_handling, underspecs, unknown, unmatched_returns]}]}.<br></span></div></blockquote><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">test.erl</span></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-family:monospace"><span style="color:rgb(178,104,24);background-color:rgb(255,255,255)">-module</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">(</span><span style="color:rgb(178,24,24);background-color:rgb(255,255,255)">test</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">).
</span><br></span>
<span style="font-family:monospace"><br><span style="color:rgb(178,104,24);background-color:rgb(255,255,255)">-export</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">(</span><span style="color:rgb(178,24,178);background-color:rgb(255,255,255)">[</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">test</span><span style="color:rgb(178,104,24);background-color:rgb(255,255,255)">/</span><span style="color:rgb(178,24,24);background-color:rgb(255,255,255)">0</span><span style="color:rgb(178,24,178);background-color:rgb(255,255,255)">]</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">).
</span><br></span>
<span style="font-family:monospace"><br><span style="color:rgb(24,24,178);background-color:rgb(255,255,255)">%% From <<a href="https://erlang.org/doc/man/proplists.html" target="_blank">https://erlang.org/doc/man/proplists.html</a>></span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br><span style="color:rgb(24,178,24);background-color:rgb(255,255,255)">-type</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)"> property() :: atom() </span><span style="color:rgb(178,24,178);background-color:rgb(255,255,255)">|</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)"> tuple().
</span><br><span style="color:rgb(24,178,24);background-color:rgb(255,255,255)">-type</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)"> proplist() :: </span><span style="color:rgb(178,24,178);background-color:rgb(255,255,255)">[</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">property()</span><span style="color:rgb(178,24,178);background-color:rgb(255,255,255)">]</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">.
</span><br><span style="color:rgb(24,178,24);background-color:rgb(255,255,255)">-spec</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)"> test() </span><span style="color:rgb(178,104,24);background-color:rgb(255,255,255)">-></span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)"> proplist().
</span><br></span><span style="font-family:monospace">test() <span style="color:rgb(178,104,24);background-color:rgb(255,255,255)">-></span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br> <span style="color:rgb(178,24,178);background-color:rgb(255,255,255)">[</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br> <span style="color:rgb(178,24,178);background-color:rgb(255,255,255)">{</span><span style="color:rgb(178,24,24);background-color:rgb(255,255,255)">one_test</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">, </span><span style="color:rgb(178,24,178);background-color:rgb(255,255,255)">[</span><span style="color:rgb(178,24,24);background-color:rgb(255,255,255)">a</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">,</span><span style="color:rgb(178,24,24);background-color:rgb(255,255,255)">b</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">,</span><span style="color:rgb(178,24,24);background-color:rgb(255,255,255)">c</span><span style="color:rgb(178,24,178);background-color:rgb(255,255,255)">]}</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">,
</span><br> <span style="color:rgb(178,24,178);background-color:rgb(255,255,255)">{</span><span style="color:rgb(178,24,24);background-color:rgb(255,255,255)">another_test</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">, </span><span style="color:rgb(178,24,178);background-color:rgb(255,255,255)">[</span><span style="color:rgb(178,24,24);background-color:rgb(255,255,255)">d</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">,</span><span style="color:rgb(178,24,24);background-color:rgb(255,255,255)">e</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">,</span><span style="color:rgb(178,24,24);background-color:rgb(255,255,255)">f</span><span style="color:rgb(178,24,178);background-color:rgb(255,255,255)">]}</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br> <span style="color:rgb(178,24,178);background-color:rgb(255,255,255)">]</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">.</span></span><span style="font-family:monospace"><br></span></blockquote><span style="font-family:monospace"><span style="font-family:monospace"></span></span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">$ rebar3 dialyzer<br></span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><span style="font-family:monospace"><span style="color:rgb(24,178,24);background-color:rgb(255,255,255)">===> Verifying dependencies...</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br><span style="color:rgb(24,178,24);background-color:rgb(255,255,255)">===> Analyzing applications...</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br><span style="color:rgb(24,178,24);background-color:rgb(255,255,255)">===> Compiling test</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br><span style="color:rgb(24,178,24);background-color:rgb(255,255,255)">===> Dialyzer starting, this may take a while...</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br><span style="color:rgb(24,178,24);background-color:rgb(255,255,255)">===> Updating plt...</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br><span style="color:rgb(24,178,24);background-color:rgb(255,255,255)">===> Resolving files...</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br><span style="color:rgb(24,178,24);background-color:rgb(255,255,255)">===> Checking 202 files in _build/default/rebar3_23.2.6_plt...</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br><span style="color:rgb(24,178,24);background-color:rgb(255,255,255)">===> Doing success typing analysis...</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br><span style="color:rgb(24,178,24);background-color:rgb(255,255,255)">===> Resolving files...</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br><span style="color:rgb(24,178,24);background-color:rgb(255,255,255)">===> Analyzing 1 files with _build/default/rebar3_23.2.6_plt...</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br>
<br><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">src/</span><span style="color:rgb(24,178,178);background-color:rgb(255,255,255)">test</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">.erl</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br><span style="color:rgb(24,178,178);background-color:rgb(255,255,255)"> </span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)"></span><span style="font-weight:bold;color:rgb(0,0,0);background-color:rgb(255,255,255)">Type specification </span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">test:test() -> proplist()</span><span style="font-weight:bold;color:rgb(0,0,0);background-color:rgb(255,255,255)"> is a supertype of the success typing: </span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">test:test() -> [{'another_test',['d' | 'e' | 'f',...]} | {'one_test',['a' | 'b' | 'c',...]},...]
</span><br><span style="color:rgb(24,178,24);background-color:rgb(255,255,255)">===> Warnings written to _build/default/23.2.6.dialyzer_warnings</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br><span style="color:rgb(178,24,24);background-color:rgb(255,255,255)">===> </span><span style="font-weight:bold;color:rgb(255,84,84);background-color:rgb(255,255,255)">Warnings occurred running dialyzer: 1</span><br></span></div></blockquote><div><br></div><div>But:<br></div><div>test.erl<br></div><div><span style="font-family:monospace"><span style="color:rgb(178,104,24);background-color:rgb(255,255,255)"></span></span></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-family:monospace"><span style="color:rgb(178,104,24);background-color:rgb(255,255,255)">-module</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">(</span><span style="color:rgb(178,24,24);background-color:rgb(255,255,255)">test</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">).
</span></span><br><span style="font-family:monospace">
</span><br><span style="font-family:monospace"><span style="color:rgb(178,104,24);background-color:rgb(255,255,255)">-export</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">(</span><span style="color:rgb(178,24,178);background-color:rgb(255,255,255)">[</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">test</span><span style="color:rgb(178,104,24);background-color:rgb(255,255,255)">/</span><span style="color:rgb(178,24,24);background-color:rgb(255,255,255)">0</span><span style="color:rgb(178,24,178);background-color:rgb(255,255,255)">]</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">).
</span></span><br><span style="font-family:monospace">
</span><br><span style="font-family:monospace"><span style="color:rgb(24,178,24);background-color:rgb(255,255,255)">-spec</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)"> test() </span><span style="color:rgb(178,104,24);background-color:rgb(255,255,255)">-></span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)"> proplists:proplist().
</span></span><br><span style="font-family:monospace">test() <span style="color:rgb(178,104,24);background-color:rgb(255,255,255)">-></span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span></span><br><span style="font-family:monospace"> <span style="color:rgb(178,24,178);background-color:rgb(255,255,255)">[</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span></span><br><span style="font-family:monospace"> <span style="color:rgb(178,24,178);background-color:rgb(255,255,255)">{</span><span style="color:rgb(178,24,24);background-color:rgb(255,255,255)">one_test</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">, </span><span style="color:rgb(178,24,178);background-color:rgb(255,255,255)">[</span><span style="color:rgb(178,24,24);background-color:rgb(255,255,255)">a</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">,</span><span style="color:rgb(178,24,24);background-color:rgb(255,255,255)">b</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">,</span><span style="color:rgb(178,24,24);background-color:rgb(255,255,255)">c</span><span style="color:rgb(178,24,178);background-color:rgb(255,255,255)">]}</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">,
</span></span><br><span style="font-family:monospace"> <span style="color:rgb(178,24,178);background-color:rgb(255,255,255)">{</span><span style="color:rgb(178,24,24);background-color:rgb(255,255,255)">another_test</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">, </span><span style="color:rgb(178,24,178);background-color:rgb(255,255,255)">[</span><span style="color:rgb(178,24,24);background-color:rgb(255,255,255)">d</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">,</span><span style="color:rgb(178,24,24);background-color:rgb(255,255,255)">e</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">,</span><span style="color:rgb(178,24,24);background-color:rgb(255,255,255)">f</span><span style="color:rgb(178,24,178);background-color:rgb(255,255,255)">]}</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span></span><br><span style="font-family:monospace"> <span style="color:rgb(178,24,178);background-color:rgb(255,255,255)">]</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">.</span></span><br><span style="font-family:monospace"></span></blockquote><span style="font-family:monospace">
<br></span><div>$ rm -rf _build</div><div>$ rebar3 dialyzer<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><span style="font-family:monospace"><span style="color:rgb(24,178,24);background-color:rgb(255,255,255)">===> Verifying dependencies...</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br><span style="color:rgb(24,178,24);background-color:rgb(255,255,255)">===> Analyzing applications...</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br><span style="color:rgb(24,178,24);background-color:rgb(255,255,255)">===> Compiling test</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br><span style="color:rgb(24,178,24);background-color:rgb(255,255,255)">===> Dialyzer starting, this may take a while...</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br><span style="color:rgb(24,178,24);background-color:rgb(255,255,255)">===> Updating plt...</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br><span style="color:rgb(24,178,24);background-color:rgb(255,255,255)">===> Resolving files...</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br><span style="color:rgb(24,178,24);background-color:rgb(255,255,255)">===> Updating base plt...</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br><span style="color:rgb(24,178,24);background-color:rgb(255,255,255)">===> Resolving files...</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br><span style="color:rgb(24,178,24);background-color:rgb(255,255,255)">===> Checking 202 files in ../../home/pzulato/.cache/rebar3/rebar3_23.2.6_plt...</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br><span style="color:rgb(24,178,24);background-color:rgb(255,255,255)">===> Copying ../../home/pzulato/.cache/rebar3/rebar3_23.2.6_plt to _build/default/rebar3_23.2.6_plt...</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br><span style="color:rgb(24,178,24);background-color:rgb(255,255,255)">===> Checking 202 files in _build/default/rebar3_23.2.6_plt...</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br><span style="color:rgb(24,178,24);background-color:rgb(255,255,255)">===> Doing success typing analysis...</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br><span style="color:rgb(24,178,24);background-color:rgb(255,255,255)">===> Resolving files...</span><span style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br><span style="color:rgb(24,178,24);background-color:rgb(255,255,255)">===> Analyzing 1 files with _build/default/rebar3_23.2.6_plt...</span><br></span></div></blockquote><div><br></div><div>So I believe it's something else.<br></div><div><br></div><div><br></div><div><div><div dir="ltr" data-smartmail="gmail_signature">Best regards,<br>Paulo Zulato<br><br>--<br>«Quis custodiet ipsos custodes?»</div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 17 May 2021 at 17:47, Fernando Benavides <<a href="mailto:elbrujohalcon@gmail.com" target="_blank">elbrujohalcon@gmail.com</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"><div dir="auto">Probably because proplists:proplist() is not in your PLT.</div><div dir="auto"><br></div><div dir="auto">Have you tried enabling the unknown warning for dialyzer?</div><div dir="auto"><br></div><div dir="auto">It will likely tell you that it doesn't know the proplists:proplist/0 type.</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 17 May 2021 at 22:25 Paulo Zulato <<a href="mailto:paulozulato@gmail.com" target="_blank">paulozulato@gmail.com</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"><div dir="ltr"><div>Hello,</div><div><br></div><div>I'm trying to figure out why dialyzer is complaining about a function when I don't explicitly declare its return as a proplist.<br></div><div>I have this small module which returns a proplist in the form <span style="font-family:monospace">{atom(), [atom()]}</span>:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-family:monospace"><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(178,104,24)">-module</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(0,0,0)">(</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(178,24,24)">test</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(0,0,0)">).
</span></span><br><span style="font-family:monospace">
</span><br><span style="font-family:monospace"><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(178,104,24)">-export</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(0,0,0)">(</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(178,24,178)">[</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(0,0,0)">test</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(178,104,24)">/</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(178,24,24)">0</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(178,24,178)">]</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(0,0,0)">).
</span></span><br><span style="font-family:monospace">
test() <span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(178,104,24)">-></span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(0,0,0)"> </span></span><br><span style="font-family:monospace"> <span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(178,24,178)">[</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(0,0,0)"> </span></span><br><span style="font-family:monospace"> <span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(178,24,178)">{</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(178,24,24)">one_test</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(0,0,0)">, </span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(178,24,178)">[</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(178,24,24)">a</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(0,0,0)">,</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(178,24,24)">b</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(0,0,0)">,</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(178,24,24)">c</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(178,24,178)">]}</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(0,0,0)">,
</span></span><br><span style="font-family:monospace"> <span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(178,24,178)">{</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(178,24,24)">another_test</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(0,0,0)">, </span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(178,24,178)">[</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(178,24,24)">d</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(0,0,0)">,</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(178,24,24)">e</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(0,0,0)">,</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(178,24,24)">f</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(178,24,178)">]}</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(0,0,0)">
</span></span><br><span style="font-family:monospace"> <span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(178,24,178)">]</span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(0,0,0)">.</span></span><br><span style="font-family:monospace"></span></blockquote><br><div>For function above, I made the following spec, but dialyzer has complained (as stated below) when I enabled its underspecs warnings<span style="font-family:monospace"><span style="font-family:monospace;background-color:rgb(24,178,178);color:rgb(0,0,0)"></span><span style="font-family:monospace;background-color:rgb(255,255,255);color:rgb(0,0,0)">.</span><br></span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-family:monospace">-spec test() -> [{atom(), [atom()]}].</span><br><span style="font-family:monospace">% src/test.erl</span><br><span style="font-family:monospace">% Type specification test:test() -> [{atom(),[atom()]}] is a supertype of the success typing: test:test() -> [{'another_test',['d' | 'e' | 'f',...]} | {'one_test',['a' | 'b' | 'c',...]},...]</span><br><span style="font-family:monospace"></span></blockquote><div><br></div><div>Well... both lists are non-empty lists as stated by dialyzer, so I modified the spec, without success:<br></div><div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-family:monospace">-spec test() -> [{atom(), [atom(), ...]}, ...].<br>%src/test.erl<br>% Type specification test:test() -> [{atom(),[atom(),...]},...] is a supertype of the success typing: test:test() -> [{'another_test',['d' | 'e' | 'f',...]} | {'one_test',['a' | 'b' | 'c',...]},...]<br></span></blockquote><div><br></div><div>Then I tried to explicitly declare it as a proplist, and dialyzer has accepted it:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-family:monospace">-spec test() -> proplists:proplist().<br></span><div><span style="font-family:monospace">% OK, no warnings.</span></div></blockquote><div><br></div><div>As it worked, I tried to do the same as proplists module does and created two types, which I used on my new spec. And, surprisingly, dialyzer has complained about it! <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><span style="font-family:monospace">% From <<a href="https://erlang.org/doc/man/proplists.html" style="font-family:monospace" target="_blank">https://erlang.org/doc/man/proplists.html</a>><br></span></div><div><span style="font-family:monospace">-type property() :: atom() | tuple().<br>-type proplist() :: [property()]. <br></span></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><span style="font-family:monospace"><br>-spec test() -> proplist().<br>%src/test.erl <br></span></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><span style="font-family:monospace">% Type specification test:test() -> proplist() is a supertype of the success typing: test:test() -> [{'another_test',['d' | 'e' | 'f',...]} | {'one_test',['a' | 'b' | 'c',...]},...]</span><br></div></blockquote><br><div></div><div></div><div>Therefore, I could not understand why declaring the return as "proplists:proplist" is OK while declaring it as lists, nonempty lists or creating the same types as proplists are not OK. Why is dialyzer complaining about the other specs? Is dialyzer handling proplists in a different way? Could someone help me to understand this behaviour?<br></div><div><br></div><div><br></div><div>Best Regards,</div><div><div><div><div dir="ltr">Paulo Zulato<br><br>--<br>«Quis custodiet ipsos custodes?»</div></div></div></div></div>
</blockquote></div></div>-- <br><div dir="ltr">Sent from Gmail Mobile by Brujo Benavides</div>
</blockquote></div>
</div>