aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2015-02-12 15:42:07 +0100
committerHans Bolinder <[email protected]>2015-02-12 15:42:07 +0100
commit3d6b7efcd7af5347def17c751cc9d411e58d82d1 (patch)
tree3c98a07c05dcc755d3d7aee6aef2cf6c928f29c5 /lib/dialyzer
parent425668272206a0f2e4b383aef0e2364e35046686 (diff)
parentf7528edda9fce8043cadb4888dbee06c1609c972 (diff)
downloadotp-3d6b7efcd7af5347def17c751cc9d411e58d82d1.tar.gz
otp-3d6b7efcd7af5347def17c751cc9d411e58d82d1.tar.bz2
otp-3d6b7efcd7af5347def17c751cc9d411e58d82d1.zip
Merge remote branch 'origin/hb/dialyzer/fix_map_type/OTP-12472' into maint
* origin/hb/dialyzer/fix_map_type/OTP-12472: [dialyzer] Fix a bug concerning map() types
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.