diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dialyzer/test/opaque_SUITE_data/results/multiple_wrong_opaques | 2 | ||||
-rw-r--r-- | lib/dialyzer/test/opaque_SUITE_data/src/multiple_wrong_opaques.erl | 8 | ||||
-rw-r--r-- | lib/hipe/cerl/erl_types.erl | 7 |
3 files changed, 11 insertions, 6 deletions
diff --git a/lib/dialyzer/test/opaque_SUITE_data/results/multiple_wrong_opaques b/lib/dialyzer/test/opaque_SUITE_data/results/multiple_wrong_opaques new file mode 100644 index 0000000000..18ece8820c --- /dev/null +++ b/lib/dialyzer/test/opaque_SUITE_data/results/multiple_wrong_opaques @@ -0,0 +1,2 @@ + +multiple_wrong_opaques.erl:5: Invalid type specification for function multiple_wrong_opaques:weird/1. The success typing is ('gazonk') -> 42 diff --git a/lib/dialyzer/test/opaque_SUITE_data/src/multiple_wrong_opaques.erl b/lib/dialyzer/test/opaque_SUITE_data/src/multiple_wrong_opaques.erl new file mode 100644 index 0000000000..9e695cec1d --- /dev/null +++ b/lib/dialyzer/test/opaque_SUITE_data/src/multiple_wrong_opaques.erl @@ -0,0 +1,8 @@ +-module(multiple_wrong_opaques). + +-export([weird/1]). + +-spec weird(dict() | gb_tree()) -> 42. + +weird(gazonk) -> 42. + diff --git a/lib/hipe/cerl/erl_types.erl b/lib/hipe/cerl/erl_types.erl index 620fed365e..aa4758c1d3 100644 --- a/lib/hipe/cerl/erl_types.erl +++ b/lib/hipe/cerl/erl_types.erl @@ -424,12 +424,7 @@ t_has_opaque_subtype(T) -> -spec t_opaque_structure(erl_type()) -> erl_type(). t_opaque_structure(?opaque(Elements)) -> - case ordsets:size(Elements) of - 1 -> - [#opaque{struct = Struct}] = ordsets:to_list(Elements), - Struct; - _ -> throw({error, "Unexpected multiple opaque types"}) - end. + t_sup([Struct || #opaque{struct = Struct} <- ordsets:to_list(Elements)]). -spec t_opaque_module(erl_type()) -> module(). |