From f7528edda9fce8043cadb4888dbee06c1609c972 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Tue, 10 Feb 2015 14:05:19 +0100 Subject: [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. --- .../test/small_SUITE_data/src/maps_redef2.erl | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 lib/dialyzer/test/small_SUITE_data/src/maps_redef2.erl (limited to 'lib/dialyzer') 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. -- cgit v1.2.3