From 324fc38bc442460f871f3ae002dd853415ae9e51 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Thu, 24 May 2018 12:21:21 +0200 Subject: dialyzer: Refine the test for overspecified functions The -Woverspecs (-Wspecdiffs) option generates warnings in a few more cases. The refinement is analogous to the test that -Wunderspecs already does: it checks if the contract has nothing in common with some element (see erl_types:t_elements/1) of the success typing. --- lib/dialyzer/test/specdiffs_SUITE_data/results/iodata | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 lib/dialyzer/test/specdiffs_SUITE_data/results/iodata (limited to 'lib/dialyzer/test/specdiffs_SUITE_data/results/iodata') diff --git a/lib/dialyzer/test/specdiffs_SUITE_data/results/iodata b/lib/dialyzer/test/specdiffs_SUITE_data/results/iodata new file mode 100644 index 0000000000..3fb12fe000 --- /dev/null +++ b/lib/dialyzer/test/specdiffs_SUITE_data/results/iodata @@ -0,0 +1,3 @@ + +iodata.erl:7: The specification for iodata:encode/2 states that the function might also return binary() but the inferred return is nonempty_maybe_improper_list(<<_:8,_:_*8>> | nonempty_maybe_improper_list(<<_:8,_:_*8>> | nonempty_maybe_improper_list(any(),<<_:8,_:_*8>> | []) | byte(),<<_:8,_:_*8>> | []) | integer(),<<_:8,_:_*8>> | []) | integer() +iodata.erl:7: The success typing for iodata:encode/2 implies that the function might also return integer() but the specification return is binary() | maybe_improper_list(binary() | maybe_improper_list(any(),binary() | []) | byte(),binary() | []) -- cgit v1.2.3