<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi all / To whom it may concern -<br>
    <br>
    Using Erlang 17.0, I get Dialyzer errors like the following:<br>
    <blockquote>{function_clause,[{erl_types,t_contains_opaque,<br>
                                  
      [{c,remote,[{remote,ssl,sslsocket,[]}],unknown}, ...}<br>
    </blockquote>
    Looking into the source, true enough, t_contains_opaque() does not
    handle the ?remote case.<br>
    The same is true of the otp master branch on github at the time of
    writing.<br>
    <br>
    This is the full output:<br>
    <blockquote>$ dialyzer --version<br>
      Dialyzer version v2.7<br>
      <br>
      $ erlc +debug_info bar.erl && dialyzer bar.beam<br>
      bar.erl:8: Warning: record state is unused<br>
        Checking whether the PLT /home/erik/.dialyzer_plt is
      up-to-date... yes<br>
        Proceeding with analysis...<br>
      =ERROR REPORT==== 7-May-2014::17:00:09 ===<br>
      Error in process <0.34.0> with exit value:
      {function_clause,[{erl_types,t_contains_opaque,[{c,remote,[{remote,ssl,sslsocket,[]}],unknown},[]],[{file,"erl_types.erl"},{line,486}]},{lists,any,2,[{file,"lists.erl"},{line,1223}]},{erl_types,t_contains_opaque,2,[{file,"erl_typ...
      <br>
      <br>
      <br>
      dialyzer: Analysis failed with error:<br>
      {function_clause,[{erl_types,t_contains_opaque,<br>
                                  
      [{c,remote,[{remote,ssl,sslsocket,[]}],unknown},<br>
                                    []],<br>
                                   [{file,"erl_types.erl"},{line,486}]},<br>
                        {lists,any,2,[{file,"lists.erl"},{line,1223}]},<br>
                        {erl_types,t_contains_opaque,2,<br>
                                   [{file,"erl_types.erl"},{line,493}]},<br>
                        {erl_types,subtype_is_equal,2,<br>
                                   [{file,"erl_types.erl"},{line,479}]},<br>
                        {erl_types,get_mod_record,3,<br>
                                  
      [{file,"erl_types.erl"},{line,4472}]},<br>
                        {erl_types,get_mod_record,5,<br>
                                  
      [{file,"erl_types.erl"},{line,4448}]},<br>
                        {erl_types,record_from_form,5,<br>
                                  
      [{file,"erl_types.erl"},{line,4424}]},<br>
                        {erl_types,type_from_form,5,<br>
                                  
      [{file,"erl_types.erl"},{line,4372}]}]}<br>
      Last messages in the log cache:<br>
        Reading files and computing callgraph... <br>
    </blockquote>
    where "bar.erl" is the following attempt at creating a minimal
    example:<br>
    <blockquote>-module(bar).<br>
      <br>
      -type f(T) :: {ssl:sslsocket(), T}.<br>
      <br>
      -record(r1, { f1 :: f(_) }).<br>
      -type r1(T) :: #r1{ f1 :: fun((ssl:sslsocket(), T) -> any()) }.<br>
      <br>
      -record(state, {<br>
                r :: r1(T),<br>
                arg :: T<br>
               }).<br>
    </blockquote>
    The following variation also triggers the bug - this one perhaps
    makes slightly more sense, as the two types for f1 are compatible:<br>
    <blockquote>-module(baz).<br>
      <br>
      -export_type([f/1]).<br>
      -type f(T) :: fun((erlang:timestamp(), T) -> any()).<br>
      <br>
      -record(r1, { f1 :: baz:f(_) }).<br>
      -type r1(T) :: #r1{ f1 :: f(T) }.<br>
      <br>
      -record(state, {<br>
                f1 :: r1(T),<br>
                arg :: T<br>
               }).<br>
    </blockquote>
    (That actually just lead me to a workaround: making both types for
    f1 remote, like this:<br>
        -record(r1, { f1 :: baz:f(_) }).<br>
        -type r1(T) :: #r1{ f1 :: baz:f(T) }.<br>
    makes the bug not be triggered. Which is nice, because then I can
    get on with my work :-))<br>
    <br>
    Regards,<br>
    Erik Søe Sørensen<br>
    <br>
    <div class="moz-signature">-- <br>
      <div style="color: black; text-align: center;"> <span>Mobile: +
          45 26 36 17 55</span> <span> </span> <span style="color:
          black; ">| Skype: eriksoesorensen</span> <span> </span> <span
          style="color: black; ">| Twitter: @eriksoe</span>
      </div>
      <div style="text-align: center; color: gray;"> <span>Trifork A/S
           |  Margrethepladsen 4  |  DK-8000 Aarhus C | </span> <a
          href="http://www.trifork.com/"><span style="text-decoration:
            underline; color: gray;">www.trifork.com</span></a>
      </div>
    </div>
  </body>
</html>