From 0d0799b4971e3353943614a311502cd4dd7b3ec9 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Tue, 5 Feb 2019 15:12:24 +0100 Subject: dialyzer: Fix a bug regarding contracts See also https://bugs.erlang.org/browse/ERL-845. Fix a bug that caused Dialyzer to crash when analyzing a contract with a module name differing from the analyzed module's name. The bug was introduced in Erlang/OTP 18. --- lib/dialyzer/test/small_SUITE_data/results/spec_other_module | 2 ++ lib/dialyzer/test/small_SUITE_data/src/spec_other_module.erl | 7 +++++++ 2 files changed, 9 insertions(+) create mode 100644 lib/dialyzer/test/small_SUITE_data/results/spec_other_module create mode 100644 lib/dialyzer/test/small_SUITE_data/src/spec_other_module.erl (limited to 'lib/dialyzer/test') diff --git a/lib/dialyzer/test/small_SUITE_data/results/spec_other_module b/lib/dialyzer/test/small_SUITE_data/results/spec_other_module new file mode 100644 index 0000000000..ab2e35cf55 --- /dev/null +++ b/lib/dialyzer/test/small_SUITE_data/results/spec_other_module @@ -0,0 +1,2 @@ + +spec_other_module.erl:7: Contract for function that does not exist: lists:flatten/1 diff --git a/lib/dialyzer/test/small_SUITE_data/src/spec_other_module.erl b/lib/dialyzer/test/small_SUITE_data/src/spec_other_module.erl new file mode 100644 index 0000000000..b36742b1bd --- /dev/null +++ b/lib/dialyzer/test/small_SUITE_data/src/spec_other_module.erl @@ -0,0 +1,7 @@ +-module(spec_other_module). + +%% OTP-15562 and ERL-845. Example provided by Kostis. + +-type deep_list(A) :: [A | deep_list(A)]. + +-spec lists:flatten(deep_list(A)) -> [A]. -- cgit v1.2.3