aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiclas Axelsson <[email protected]>2010-12-21 15:35:55 +0100
committerNiclas Axelsson <[email protected]>2010-12-21 15:35:55 +0100
commit4721cdba76cfa5d830413895a766394389712868 (patch)
tree300ab7c5fa26d8d38837aa21d2862f8e6ea42302
parentc01de41db669a595cf49e0df735514edf54f311a (diff)
parent21768de9bb18c968e71494c07375089191087b79 (diff)
downloadotp-4721cdba76cfa5d830413895a766394389712868.tar.gz
otp-4721cdba76cfa5d830413895a766394389712868.tar.bz2
otp-4721cdba76cfa5d830413895a766394389712868.zip
Merge branch 'sa/dialyzer-or-fix' into dev
-rw-r--r--lib/dialyzer/src/dialyzer_typesig.erl10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/dialyzer/src/dialyzer_typesig.erl b/lib/dialyzer/src/dialyzer_typesig.erl
index f68472d2fc..c45615d670 100644
--- a/lib/dialyzer/src/dialyzer_typesig.erl
+++ b/lib/dialyzer/src/dialyzer_typesig.erl
@@ -1406,9 +1406,13 @@ get_bif_constr({erlang, 'or', 2}, Dst, [Arg1, Arg2] = Args, _State) ->
ArgV1 = mk_fun_var(ArgFun(Arg2), [Arg2, Dst]),
ArgV2 = mk_fun_var(ArgFun(Arg1), [Arg1, Dst]),
DstV = mk_fun_var(DstFun, Args),
- Disj = mk_disj_constraint_list([mk_constraint(Arg1, sub, True),
- mk_constraint(Arg2, sub, True),
- mk_constraint(Dst, sub, False)]),
+ F = fun(A) ->
+ try [mk_constraint(A, sub, True)]
+ catch throw:error -> []
+ end
+ end,
+ Constrs = F(Arg1) ++ F(Arg2),
+ Disj = mk_disj_constraint_list([mk_constraint(Dst, sub, False)|Constrs]),
mk_conj_constraint_list([mk_constraint(Dst, sub, DstV),
mk_constraint(Arg1, sub, ArgV1),
mk_constraint(Arg2, sub, ArgV2),