aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/test
AgeCommit message (Collapse)Author
2018-02-21dialyzer: Correct a parameterized opaque types bugHans Bolinder
See also https://bugs.erlang.org/browse/ERL-565. To avoid loops, erl_types:t_is_subtype checks for equality using unopaqued types, but in (at least) one case something is lost: This fix makes sure that when forwarding arguments in dataflow, types with different parameters but equal when unopaqued are considered different. For example, dict:dict(0, {}) and dict:dict(0, []) are equal when unopaqued (due to how dict(_, _) is declared in module dict), but should be considered different when forwarding args.
2018-02-14dialyzer: Fix a crashHans Bolinder
2018-01-12dialyzer: Fix bsl/2 bugHans Bolinder
Also modified erl_bif_types:infinity_bsl() when called with zero as first argument. As of writing this, erlang:'bsl'/2 is modified on the master branch to never fail if called with a huge second argument.
2018-01-09dialyzer: Add a test of erl_tar:table/1,2Hans Bolinder
2018-01-08dialyzer: Correct handling of erlang:abs/1Hans Bolinder
See also https://bugs.erlang.org/browse/ERL-551.
2017-11-22dialyzer: Extend the map implementation's handling of ?unitHans Bolinder
The Maps implementation handles ?unit in more cases. Exactly when t_is_none_or_unit() is to be called is not clear to me. The added cases are about a map type being ?unit, but the key or the value of an association can also be ?unit, but that is not always checked.
2017-11-22dialyzer: Use string:find() instead of string:str()Hans Bolinder
2017-11-10dialyzer: Display error messages without call stackHans Bolinder
As of commit 12b379 many of the reasons displayed after "Analysis failed with error:" erroneously include a call stack. The bug is now corrected. The bug was pointed out in http://erlang.org/pipermail/erlang-questions/2017-October/093838.html.
2017-09-18Merge branch 'hasse/dialyzer/map_fixes/OTP-14572' into maintHans Bolinder
* hasse/dialyzer/map_fixes/OTP-14572: dialyzer: Adjust a test case dialyzer: Modify handling of singleton map key types Dialyzer: Rewrite one map type invariant Dialyzer: Rewrite some of the docs of map types
2017-09-15dialyzer: Improve check of unknown typesHans Bolinder
The implementation of OTP-14218 (commit 6d3b38a) has a weakness: only a very limited part of the type form is checked. This is now fixed: types not used by specs are checked equally well as types used by specs. The new function erl_types:t_from_form_check_remote() checks usage of remote types. It does not expand used local types, and has (almost) no limits on depth and size.
2017-09-12dialyzer: Adjust a test caseHans Bolinder
Huge maps are truncated differently by the pretty printer. The reason is that erl_types:is_singleton_type/1 no longer recognizes complex singleton types, which results in a less precise representation of map types.
2017-09-12dialyzer: Modify handling of singleton map key typesHans Bolinder
The test case loop.erl shows that there is a problem with certain singleton key types. Here the internal representation toggles between #{a | b => ...} and #{a => ..., b => ...} The choice is to turn #{a | b => ...} into #{a => ..., b => ...} early (t_from_form()). The aim is to keep as much info as possible (in pairs). However, including complex singleton keys (tuples, maps) in this scheme is potentially too costly, and a bit complicated. So one more choice is made: let atoms and number (and nothing else) be singleton types, and let complex keys go into the default key.
2017-06-13dialyzer: Do not use two records for PLTsHans Bolinder
Instead of two records, #plt{} with dict:s and #mini_plt{} with ETS tables, one record is used for representing PLT:s in RAM. The #mini_plt{} is the one now used throughout analyses, but it is called #plt{}. When writing the PLT to file, another record is used, #file_plt{} (as before). When creating #file_plt{}, the #plt{} is deleted (it cannot be used for further analyses).
2017-06-13dialyzer: Warn about unused unknown typesHans Bolinder
2017-06-09dialyzer: Improve handling of UnicodeHans Bolinder
2017-05-02Merge branch 'maint'Hans Bolinder
* maint: Updated OTP version Prepare release inets: Add missing release note dialyzer: Fix a bug regarding unknown types erl_mseg.c: don't use invalid indices in - > cache_powered_node[] Fix release note for OTP-14290 Conflicts: OTP_VERSION erts/emulator/sys/common/erl_mseg.c erts/vsn.mk lib/dialyzer/src/dialyzer_analysis_callgraph.erl
2017-04-26dialyzer: Fix a bug regarding unknown typesHans Bolinder
Since commit 12b3790 Dialyzer has not reported unknown types.
2017-04-24Merge branch 'zandra/stdlib/optional-callbacks/OTP-13801'Zandra Norman
* zandra/stdlib/optional-callbacks/OTP-13801: wx: make wx_object callbacks optional stdlib: Make gen_fsm callbacks optional stdlib: Make gen_event callbacks optional stdlib: Make gen_server callbacks optional
2017-04-21stdlib: Make gen_server callbacks optionalZandra Norman
2017-04-21Merge branch 'bjorn/dialyzer/add-typer/OTP-14336' into run-travisBjörn Gustavsson
* bjorn/dialyzer/add-typer/OTP-14336: Add smoke test for TypER Add back TypEr to the main OTP repository
2017-04-20Add smoke test for TypERBjörn Gustavsson
2017-04-13stdlib: Add checks of the dialyzer attribute to the linterHans Bolinder
The same checks are also performed by the Dialyzer.
2017-03-14Merge branch 'hasse/fix_erl_anno_use'Hans Bolinder
* hasse/fix_erl_anno_use: parsetools: Fix handling of locations and annotations diameter: Fix handling of locations and annotations kernel: Fix handling of locations and annotations compiler: Fix handling of locations and annotations eunit: Fix handling of locations and annotations Update preloaded erts: Fix handling of locations and annotations dialyzer: Fix handling of annotations in a test debugger: Fix handling of locations and annotations stdlib: Extend functions in erl_parse to handle form_info() stdlib: Fix handling of locations and annotations erts: Correct the documentation of abstract end-of-file stdlib: Add debug tests to the erl_parse module stdlib: improve the erl_anno module's debug tests stdlib: Improve the erl_pp module's debug tests
2017-03-08dialyzer: Correct a test caseHans Bolinder
2017-03-08dialyzer: Fix handling of annotations in a testHans Bolinder
2017-03-06Merge branch 'maint'Hans Bolinder
* maint: dialyzer: Improve a warning dialyzer: Fix a weird warning dialyzer: Fix an opaque bug dialyzer: Minor fix Conflicts: lib/dialyzer/src/dialyzer_dataflow.erl
2017-03-06Merge branch 'hasse/dialyzer/fix_warnings/OTP-14177' into maintHans Bolinder
* hasse/dialyzer/fix_warnings/OTP-14177: dialyzer: Improve a warning dialyzer: Fix a weird warning dialyzer: Fix an opaque bug dialyzer: Minor fix
2017-03-06Merge branch 'maint'Siri Hansen
2017-03-01Fix typos: lenght -> lengthMyron Marston
2017-02-28dialyzer: Improve a warningHans Bolinder
When a pattern a type do not match, opaque warnings were given precedence before structure mismatches. This is no longer always the case. Mentioned by Nick Marino on erlang-questions.
2017-02-28dialyzer: Fix a weird warningHans Bolinder
2017-02-28dialyzer: Fix an opaque bugHans Bolinder
An opaque bug that would crash Dialyzer has been fixed. The bug was reported by Nick Marino.
2017-02-21dialyzer: Correct test cases after removal of erlang:hash/2Hans Bolinder
2017-02-20Add dummy end_per_suite/1Siri Hansen
common_test requires that if init_per_suite/1 exists, then end_per_suite/1 must also exist. If end_per_suite/1 does not exist, then it will be marked in the log as failed with reason 'undef'. Some test suites are corrected to avoid this.
2017-02-14Fixed typos in lib/dialyzerAndrew Dryga
2017-02-09Merge branch 'maint'Hans Bolinder
* maint: dialyzer: Correct PLT tests
2017-02-03dialyzer: Correct PLT testsHans Bolinder
Use explicit file names of PLTs so that daily builds&tests running simultaneously under the same user do not interfere with each other ("$HOME/.dialyzer_plt" is the default PLT name).
2017-02-03Merge branch 'maint'Hans Bolinder
* maint: dialyzer: Increase time limit for tests dialyzer: Optimize typesig dialyzer: Optimize evaluation of complex code dialyzer: Optimize collection of variables Conflicts: lib/dialyzer/src/dialyzer_typesig.erl
2017-02-01dialyzer: Increase time limit for testsHans Bolinder
2017-01-25Update test cases for erlang:hash/2 removalBjörn-Egil Dahlberg
2017-01-12Merge branch 'maint'Hans Bolinder
* maint: stdlib: Correct signatures of functions in erl_parse
2017-01-10stdlib: Correct signatures of functions in erl_parseHans Bolinder
The signatures of erl_parse:anno_to_term/1 and erl_parse:anno_from_term/1 are corrected. Using these function no longer results in false Dialyzer warnings.
2017-01-10Merge branch 'maint'Hans Bolinder
* maint: stdlib: Allow characters in types and constant patterns
2016-12-21stdlib: Allow characters in types and constant patternsHans Bolinder
Characters ($char) can be used in constant pattern expressions. They can also be used in types and contracts.
2016-12-07Update copyright-yearErlang/OTP
2016-11-23Correct copyright and license on dialyzer filesRichard Carlsson
2016-11-23Merge branch 'maint'Hans Bolinder
* maint: dialyzer: Substitute 'opacity' for 'opaqueness' dialyzer: Improve a warning message dialyzer: Improve a warning message dialyzer: Correct a warnings message
2016-11-22dialyzer: Substitute 'opacity' for 'opaqueness'Hans Bolinder
Suggested by Kostis.
2016-11-22dialyzer: Improve a warning messageHans Bolinder
Messages regarding guards with orelse/andalso could look like "Clause guard cannot succeed. The variable A was matched against the type any()". Now they look like as if or/and is used: "Guard test is_integer(A::atom()) can never succeed".
2016-11-22dialyzer: Improve a warning messageHans Bolinder
Messages like "Invalid type specification for function para3:exp_adt/0. The success typing is () -> 3" now look like "The specification for para3:exp_adt/0 has an opaque subtype para3_adt:exp1(para3_adt:exp2()) which is violated by the success typing () -> 3". The old message did not give any clue as to what invalidated the contract, namely the opaque subtype.