<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi,<br>
<br>
[Shayan Pooya:]<br>
> In order to make Disco compile with Erlang 17 without warnings, I<br>
> added nowarn_deprecated_type to silence the warnings. However, after<br>
> doing so, dialyzer fails with the following error:<br>
><br>
> ddfs_master.erl:345: Attempt to test for inequality between a term of type 'false' and a term of opaque type 'false' | gb_set()<br>
<br>
This is a bug. There will be a fix in 17.1. You can<br>
try the patch below, or run Dialyzer with the "-Wno_opaque" option.<br>
<br>
Best regards,<br>
<br>
Hans Bolinder, Erlang/OTP team, Ericsson<br>
<br>
diff --git a/lib/hipe/cerl/erl_types.erl b/lib/hipe/cerl/erl_types.erl<br>
index 47b8dc7..6065b79 100644<br>
--- a/lib/hipe/cerl/erl_types.erl<br>
+++ b/lib/hipe/cerl/erl_types.erl<br>
@@ -2985,16 +2985,19 @@ inf_union(U1, U2, Opaques) -><br>
         List = [A,B,F,I,L,N,T,M,Map],<br>
         inf_union_collect(List, Opaque, InfFun, [], [])<br>
     end,<br>
-  O1 = OpaqueFun(U1, U2, fun(E, Opaque) -> t_inf(Opaque, E, Opaques) end),<br>
-  O2 = OpaqueFun(U2, U1, fun(E, Opaque) -> t_inf(E, Opaque, Opaques) end),<br>
-  Union = inf_union(U1, U2, 0, [], Opaques),<br>
-  t_sup([O1, O2, Union]).<br>
+  {O1, ThrowList1} =<br>
+    OpaqueFun(U1, U2, fun(E, Opaque) -> t_inf(Opaque, E, Opaques) end),<br>
+  {O2, ThrowList2}<br>
+    = OpaqueFun(U2, U1, fun(E, Opaque) -> t_inf(E, Opaque, Opaques) end),<br>
+  {Union, ThrowList3} = inf_union(U1, U2, 0, [], [], Opaques),<br>
+  ThrowList = lists:merge3(ThrowList1, ThrowList2, ThrowList3),<br>
+  case t_sup([O1, O2, Union]) of<br>
+    ?none when ThrowList =/= [] -> throw(hd(ThrowList));<br>
+    Sup -> Sup<br>
+  end.<br>
 <br>
 inf_union_collect([], _Opaque, _InfFun, InfList, ThrowList) -><br>
-  case t_sup(InfList) of<br>
-    ?none when ThrowList =/= [] -> throw(hd(lists:flatten(ThrowList)));<br>
-    Sup -> Sup<br>
-  end;<br>
+  {t_sup(InfList), lists:usort(ThrowList)};<br>
 inf_union_collect([?none|L], Opaque, InfFun, InfList, ThrowList) -><br>
   inf_union_collect(L, Opaque, InfFun, [?none|InfList], ThrowList);<br>
 inf_union_collect([E|L], Opaque, InfFun, InfList, ThrowList) -><br>
@@ -3005,19 +3008,21 @@ inf_union_collect([E|L], Opaque, InfFun, InfList, ThrowList) -><br>
       inf_union_collect(L, Opaque, InfFun, InfList, [N|ThrowList])<br>
   end.<br>
 <br>
-inf_union([?none|Left1], [?none|Left2], N, Acc, Opaques) -><br>
-  inf_union(Left1, Left2, N, [?none|Acc], Opaques);<br>
-inf_union([T1|Left1], [T2|Left2], N, Acc, Opaques) -><br>
-  case t_inf(T1, T2, Opaques) of<br>
-    ?none -> inf_union(Left1, Left2, N, [?none|Acc], Opaques);<br>
-    T     -> inf_union(Left1, Left2, N+1, [T|Acc], Opaques)<br>
+inf_union([?none|Left1], [?none|Left2], N, Acc, ThrowList, Opaques) -><br>
+  inf_union(Left1, Left2, N, [?none|Acc], ThrowList, Opaques);<br>
+inf_union([T1|Left1], [T2|Left2], N, Acc, ThrowList, Opaques) -><br>
+  try t_inf(T1, T2, Opaques) of<br>
+    ?none -> inf_union(Left1, Left2, N, [?none|Acc], ThrowList, Opaques);<br>
+    T     -> inf_union(Left1, Left2, N+1, [T|Acc], ThrowList, Opaques)<br>
+  catch throw:N when is_integer(N) -><br>
+      inf_union(Left1, Left2, N, [?none|Acc], [N|ThrowList], Opaques)<br>
   end;<br>
-inf_union([], [], N, Acc, _Opaques) -><br>
-  if N =:= 0 -> ?none;<br>
+inf_union([], [], N, Acc, ThrowList, _Opaques) -><br>
+  if N =:= 0 -> {?none, ThrowList};<br>
      N =:= 1 -><br>
       [Type] = [T || T <- Acc, T =/= ?none],<br>
-      Type;<br>
-     N >= 2  -> ?union(lists:reverse(Acc))<br>
+      {Type, ThrowList};<br>
+     N >= 2  -> {?union(lists:reverse(Acc)), ThrowList}<br>
   end.<br>
 <br>
 inf_bitstr(U1, B1, U2, B2) -><br>
<br>
</div>
</body>
</html>