aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer
AgeCommit message (Collapse)Author
2016-04-28erl_types: Fix crash merging maps with opaque keysMagnus Lång
Opaque keys in maps broke an assumption in erl_types:mapmerge_otherv/3 (that the infinimum of a singleton type and some other type would either be none() or that same singleton type), causing a case_clause crash.
2016-04-28dialyzer_typesig: Fix bad external typeMagnus Lång
28a4a5057ab9 mistakenly used the non-existing type cerl:tree() instead of cerl:cerl().
2016-04-28dialyzer: Fix another pattern literal bugMagnus Lång
dialyzer_typesig:traverse/3 would perform an unsafe optimisation when given a cons pattern that contained a map and could be folded into a literal with cerl:fold_literal/1. In this case, when traversing the map a type variable would be generated, but this variable would be dropped by the erl_types:t_cons/2 constructor by in turn calling t_sup(), producing the overapproximation any(). However, in this particular case, dialyzer_typesig:traverse/3 is not allowed to overapproximate, since its result is used in an EQ-constraint. Although erl_types:t_tuple/1 does not overapproximate like t_cons/2, which makes the bug unlikely to affect tuples too, the fix was nevertheless applied defensively to the case of tuples as well. Also, fix a bug where dialyzer_utils:refold_pattern/1 would generate syntax nodes with two {label, _} attributes.
2016-04-28Bump Dialyzer versionMagnus Lång
Because the type representation has changed, old PLTs are not compatible. We update the version to 2.10 because of this.
2016-04-28dialyzer: Improve map pattern typesettingMagnus Lång
2016-04-28dialyzer_contracts: Consider #{} a violationMagnus Lång
This is analogous to the case of nil. Since #{} is a base-case of almost all map types, contract and success typing sharing #{} does not mean much, and is often sign of a violation.
2016-04-28dialyzer_typesig: Fix simplification bugMagnus Lång
mk_constraint_list/2 was simplifying (C OR TriviallyTrue) to (C), which is obviously wrong.
2016-04-28dialyzer_dataflow: Fix try in guardsMagnus Lång
The assumption that 'try' nodes were only used to wrap entire guards is no longer true. We're still swallowing warnings when the handler returns successfully. Unfortunately, bind_guard/5 would need to be refactored to return a new state in order to generate those warnings.
2016-04-28dialyzer: Unfold cerl patterns containing mapsMagnus Lång
Dialyzer relies heavily on the assumption that the type of a literal that is used as a pattern is the type of any value that can match that pattern. For maps, that is not true, and it was causing bad analysis results. A new help function dialyzer_utils:refold_pattern/1 identifies maps in literal patterns, and unfolds and labels them, allowing them to be properly analysed.
2016-04-28dialyzer_dataflow: Add map supportMagnus Lång
2016-04-28dialyzer_typesig: Add map supportMagnus Lång
2016-04-28Enhance map specs in erts, stdlib, runtime_toolsMagnus Lång
Using the new type syntax, we can specify which keys are required, and which are optional in a way Dialyzer could use.
2016-04-28erl_bif_types: Add a selection of maps BIFsMagnus Lång
* maps:from_list/1 * maps:get/2 * maps:is_key/2 * maps:merge/2 * maps:put/3 * maps:size/1 * maps:to_list/1 * maps:update/3
2016-04-28erl_types: Add a map type representationMagnus Lång
The type of a map is represented as a three-tuple {Pairs, DefaultKey, DefaultValue}. DefaultKey and DefaultValue are types. Pairs is a list of three-tuples {Key, mandatory | optional, Value}, where Key and Value are types. All types Key must be singleton, or "known at compile time," as the EEP put it. Examples: #{integer()=>list()} {[], integer(), list()} #{a=>char(), b=>atom()} {[{a, optional, char()}, {b, optional, atom()}], none(), none()} map() {[], any(), any()} A more formal description of the representation and its invariants can be found in erl_types.erl Special thanks to Daniel S. McCain (@dsmccain) that co-authored a very early version of this with me back in April 2014, although only the singleton type logic remains from that version.
2016-04-19stdlib: Fix warningsHans Bolinder
2016-04-07Correct mispelling in Dialyzer's acronym definitioneksperimental
"DIscrepany" is replaced with "DIscrepancy" in every occurrence.
2016-03-15update copyright-yearHenrik Nord
2016-03-15Merge tag 'OTP-18.3'Lars Thorsen
=== OTP-18.3 === Changed Applications: - asn1-4.0.2 - common_test-1.12 - compiler-6.0.3 - cosNotification-1.2.1 - cosTime-1.2.1 - cosTransactions-1.3.1 - crypto-3.6.3 - debugger-4.1.2 - dialyzer-2.9 - diameter-1.11.2 - edoc-0.7.18 - eldap-1.2.1 - erl_docgen-0.4.2 - erl_interface-3.8.2 - erts-7.3 - eunit-2.2.13 - hipe-3.15 - inets-6.2 - kernel-4.2 - mnesia-4.13.3 - observer-2.1.2 - orber-3.8.1 - public_key-1.1.1 - runtime_tools-1.9.3 - sasl-2.7 - snmp-5.2.2 - ssh-4.2.2 - ssl-7.3 - stdlib-2.8 - test_server-3.10 - tools-2.8.3 - webtool-0.9.1 - wx-1.6.1 - xmerl-1.3.10 Unchanged Applications: - cosEvent-2.2 - cosEventDomain-1.2 - cosFileTransfer-1.2 - cosProperty-1.2 - et-1.5.1 - gs-1.6 - ic-4.4 - jinterface-1.6.1 - megaco-3.18 - odbc-2.11.1 - os_mon-2.4 - ose-1.1 - otp_mibs-1.1 - parsetools-2.1.1 - percept-0.8.11 - reltool-0.7 - syntax_tools-1.7 - typer-0.9.10 Conflicts: OTP_VERSION erts/vsn.mk lib/test_server/doc/src/notes.xml lib/test_server/vsn.mk lib/webtool/doc/src/notes.xml lib/webtool/vsn.mk
2016-03-14Prepare releaseErlang/OTP
2016-02-17Eliminate use of test_server.hrl and test_server_line.hrlBjörn Gustavsson
As a first step to removing the test_server application as as its own separate application, change the inclusion of test_server.hrl to an inclusion of ct.hrl and remove the inclusion of test_server_line.hrl.
2016-02-10Merge branch 'maint'Hans Bolinder
* maint: dialyzer: Correct byte_size() and comparisons Conflicts: lib/hipe/cerl/erl_bif_types.erl
2016-02-09dialyzer: Correct byte_size() and comparisonsHans Bolinder
The argument of byte_size() is a bitstring(). The code in erl_bif_types that finds cases where comparisons always return true or false is corrected when it comes to maps and bit strings.
2016-02-08Merge branch 'maint'Hans Bolinder
* maint: dialyzer: Fix a bug concerning the option 'plt_remove'
2016-02-08dialyzer: Fix a bug concerning the option 'plt_remove'Hans Bolinder
[James Fish:] Dialyzer always asserts that files and directories passed in its options exist. Therefore it is not possible to remove a beam/module from a PLT when the beam file no longer exists. Dialyzer should not to check files exist on disk when removing from the PLT.
2016-02-02Merge branch 'maint'Zandra
Conflicts: lib/dialyzer/src/dialyzer_analysis_callgraph.erl
2016-02-02Merge branch 'aronisstav/dialyzer-missing-callback-info' into maintZandra
* aronisstav/dialyzer-missing-callback-info: Fix inadvertent deletion of callback info Eliminate ugly case statements Remove dead code related to missing behaviour info OTP-13287
2016-02-01dialyzer: Remove t_parameterized_module/0 from erl_typesStavros Aronis
Parameterized modules are no longer supported, so module() can only be an atom().
2016-01-27Clarify usage of coordinator by analysis_callgraphLuca Favatella
* Comment in dialyzer_analysis_callgraph what the call to dialyzer_coordinator does; * Delegate activation request to each dialyzer_worker; * There is no reason for the dialyzer_coordinator to request activation on behalf of the workers: let each worker request its own activation as it leads to more consistent dialyzer_worker module (activation is request as soon as status running is hit - reguardless of mode) and it reduces lines of code. * Clarify types in coordinator and worker e.g. make opaque and make type more strict.
2016-01-27Reflect more init-loop OTP pattern in dialyzer_workerLuca Favatella
Also clarify in which modes the states `updating` and `waiting` can happen in the loop.
2016-01-27Delete dead sequential code in dialyzer_workerLuca Favatella
2016-01-26Clarify computation of exported types in DialyzerLuca Favatella
Superfluous usage of insert_temp_exported_types had been in since 6452b57. (Change in commit 8a3ea1f module dialyzer_analysis_callgraph is a correct simplification and is not relevant.)
2016-01-26Split race_data_server out of dialyzer_callgraphLuca Favatella
... in order to reduce size of module dialyzer_callgraph, down from ~850 to ~750 lines.
2016-01-26Refactor dialyzer_analysis_callgraphLuca Favatella
2016-01-26Refactor usage of opaques() typeLuca Favatella
2016-01-26Clarify that dialyzer_callgraph:callgraph() type is opaqueLuca Favatella
2016-01-26Delete a couple of leftover chars in Dialyzer docLuca Favatella
2016-01-20dialyzer: Correct a test caseHans Bolinder
2016-01-20dialyzer: Improve a typeHans Bolinder
2016-01-18Merge branch 'maint'Björn-Egil Dahlberg
2016-01-14dialyzer: Update Maps testsBjörn-Egil Dahlberg
2016-01-11Fix inadvertent deletion of callback infoStavros Aronis
If a behaviour module contains an non-exported function with the same name as one of the behaviour's callbacks, the callback info was inadvertently deleted from the PLT as the dialyzer_plt:delete_list/2 function was cleaning up the callback table. This bug was reported by Brujo Benavides. Fixes ERL-72 bug report.
2016-01-11Eliminate ugly case statementsStavros Aronis
2016-01-11Remove dead code related to missing behaviour infoStavros Aronis
Dialyzer used to report unknown behaviours in the same way as unknown functions and types. This functionality has been removed in d101155, but some code remained.
2015-12-28Merge branch 'maint'Zandra
2015-12-28Merge branch 'lucafavatella/dialyzer-fun-call' into maintZandra
* lucafavatella/dialyzer-fun-call: Teach Dialyzer call to funs `M:F/A` (literal M, F, A) OTP-13217
2015-12-16Merge tag 'OTP-18.2'Henrik Nord
=== OTP-18.2 === Changed Applications: - asn1-4.0.1 - common_test-1.11.1 - compiler-6.0.2 - crypto-3.6.2 - dialyzer-2.8.2 - diameter-1.11.1 - erl_docgen-0.4.1 - erl_interface-3.8.1 - erts-7.2 - eunit-2.2.12 - hipe-3.14 - inets-6.1 - jinterface-1.6.1 - kernel-4.1.1 - observer-2.1.1 - parsetools-2.1.1 - public_key-1.1 - runtime_tools-1.9.2 - sasl-2.6.1 - snmp-5.2.1 - ssh-4.2 - ssl-7.2 - stdlib-2.7 - test_server-3.9.1 - tools-2.8.2 - typer-0.9.10 - wx-1.6 - xmerl-1.3.9 Unchanged Applications: - cosEvent-2.2 - cosEventDomain-1.2 - cosFileTransfer-1.2 - cosNotification-1.2 - cosProperty-1.2 - cosTime-1.2 - cosTransactions-1.3 - debugger-4.1.1 - edoc-0.7.17 - eldap-1.2 - et-1.5.1 - gs-1.6 - ic-4.4 - megaco-3.18 - mnesia-4.13.2 - odbc-2.11.1 - orber-3.8 - os_mon-2.4 - ose-1.1 - otp_mibs-1.1 - percept-0.8.11 - reltool-0.7 - syntax_tools-1.7 - webtool-0.9 Conflicts: OTP_VERSION erts/vsn.mk
2015-12-15Update release notesErlang/OTP
2015-12-15Update version numbersErlang/OTP
2015-12-15dialyzer: Print constraints using the '::' syntaxHans Bolinder
2015-11-04Merge branch 'maint'Hans Bolinder
* maint: [erl_docgen] Correct documentation [dialyzer] Correct documentation [hipe] Correct documentation [test_server] Correct documentation [tools] Correct documentation [erts] Correct documentation [stdlib] Correct documentation [kernel] Correct documentation Conflicts: lib/stdlib/doc/src/erl_scan.xml