diff options
author | Hans Bolinder <[email protected]> | 2015-02-10 14:05:19 +0100 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2015-02-10 14:05:19 +0100 |
commit | f7528edda9fce8043cadb4888dbee06c1609c972 (patch) | |
tree | f6aba4a139b71da5e556501764664dec42df02d5 /lib/dialyzer/test/small_SUITE_data | |
parent | 33156218401ba0ba489d0d787367af82f56c5f3c (diff) | |
download | otp-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/test/small_SUITE_data')
-rw-r--r-- | lib/dialyzer/test/small_SUITE_data/src/maps_redef2.erl | 23 |
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. |