aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/test
diff options
context:
space:
mode:
authorKostis Sagonas <[email protected]>2013-10-09 17:09:17 +0200
committerKostis Sagonas <[email protected]>2013-10-09 17:09:17 +0200
commite978ff2a2c634ef2a4af7372cf2ecce8d70743b9 (patch)
tree0d498ac0a4041d66c6491f00a43a4821353e0c8f /lib/dialyzer/test
parent3a481b4a687803b69ede848a75299b4b277f4296 (diff)
downloadotp-e978ff2a2c634ef2a4af7372cf2ecce8d70743b9.tar.gz
otp-e978ff2a2c634ef2a4af7372cf2ecce8d70743b9.tar.bz2
otp-e978ff2a2c634ef2a4af7372cf2ecce8d70743b9.zip
Fix crash when using remote types in the tail of list types
Hans Bolider reported a dialyzer crash when using a remote type in the tail position of a maybe_improper_list() declaration. A test was created (by extending an existing module of the testsuite) and erl_types was modified to expand the remote type and not pass it unexpanded to subsequent phases in the processing.
Diffstat (limited to 'lib/dialyzer/test')
-rw-r--r--lib/dialyzer/test/small_SUITE_data/src/maybe_improper.erl17
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/dialyzer/test/small_SUITE_data/src/maybe_improper.erl b/lib/dialyzer/test/small_SUITE_data/src/maybe_improper.erl
index 1743d81493..6d2a35b7c8 100644
--- a/lib/dialyzer/test/small_SUITE_data/src/maybe_improper.erl
+++ b/lib/dialyzer/test/small_SUITE_data/src/maybe_improper.erl
@@ -1,7 +1,18 @@
+%%%========================================================================
+%%% Tests handling of maybe improper lists
+%%%========================================================================
-module(maybe_improper).
--export([s/1]).
+-export([s/1, t/0]).
-spec s(maybe_improper_list(X,Y)) -> {[X], maybe_improper_list(X,Y)}.
-s(A) ->
- lists:split(2,A).
+s(L) ->
+ lists:split(2, L).
+
+%% Having a remote type in the 'tail' of the list crashed dialyzer.
+%% The problem was fixed for R16B03.
+-type t_mil() :: maybe_improper_list(integer(), orddict:orddict()).
+
+-spec t() -> t_mil().
+t() ->
+ [42 | []].