aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2015-02-10 14:05:19 +0100
committerHans Bolinder <[email protected]>2015-02-10 14:05:19 +0100
commitf7528edda9fce8043cadb4888dbee06c1609c972 (patch)
treef6aba4a139b71da5e556501764664dec42df02d5 /lib/dialyzer
parent33156218401ba0ba489d0d787367af82f56c5f3c (diff)
downloadotp-f7528edda9fce8043cadb4888dbee06c1609c972.tar.gz
otp-f7528edda9fce8043cadb4888dbee06c1609c972.tar.bz2
otp-f7528edda9fce8043cadb4888dbee06c1609c972.zip
[dialyzer] Fix a bug concerning map() types
It is allowed in Erlang/OTP 17 to redefine the map() types. However, Dialyzer did not handle local map() types correctly.
Diffstat (limited to 'lib/dialyzer')
-rw-r--r--lib/dialyzer/test/small_SUITE_data/src/maps_redef2.erl23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/dialyzer/test/small_SUITE_data/src/maps_redef2.erl b/lib/dialyzer/test/small_SUITE_data/src/maps_redef2.erl
new file mode 100644
index 0000000000..945b2a9144
--- /dev/null
+++ b/lib/dialyzer/test/small_SUITE_data/src/maps_redef2.erl
@@ -0,0 +1,23 @@
+%% In 17, the linter says that map(A) redefines 'type map', which is
+%% allowed until next release. However, Dialyzer used to replace
+%% map(A) with #{}, which resulted in warnings.
+
+-module(maps_redef2).
+
+-export([t/0]).
+
+-type map(_A) :: integer().
+
+t() ->
+ M = new(),
+ t1(M).
+
+-spec t1(map(_)) -> map(_).
+
+t1(A) ->
+ A + A.
+
+-spec new() -> map(_).
+
+new() ->
+ 3.