Age | Commit message (Collapse) | Author |
|
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.
|
|
* maint:
dialyzer: Correct byte_size() and comparisons
Conflicts:
lib/hipe/cerl/erl_bif_types.erl
|
|
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.
|
|
* maint:
dialyzer: Fix a bug concerning the option 'plt_remove'
|
|
[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.
|
|
Conflicts:
lib/dialyzer/src/dialyzer_analysis_callgraph.erl
|
|
* 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
|
|
Parameterized modules are no longer supported, so module() can only be
an atom().
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
* lucafavatella/dialyzer-fun-literal-arity:
Teach Dialyzer arity of funs with literal arity
OTP-13068
|
|
Record field types have been modified due to commit 8ce35b2:
"Take out automatic insertion of 'undefined' from typed record fields".
|
|
Background
-----------
In record fields with a type declaration but without an initializer, the
Erlang parser inserted automatically the singleton type 'undefined' to
the list of declared types, if that value was not present there.
I.e. the record declaration:
-record(rec, {f1 :: float(),
f2 = 42 :: integer(),
f3 :: some_mod:some_typ()}).
was translated by the parser to:
-record(rec, {f1 :: float() | 'undefined',
f2 = 42 :: integer(),
f3 :: some_mod:some_typ() | 'undefined'}).
The rationale for this was that creation of a "dummy" #rec{} record
should not result in a warning from dialyzer that e.g. the implicit
initialization of the #rec.f1 field violates its type declaration.
Problems
---------
This seemingly innocent action has some unforeseen consequences.
For starters, there is no way for programmers to declare that e.g. only
floats make sense for the f1 field of #rec{} records when there is no
`obvious' default initializer for this field. (This also affects tools
like PropEr that use these declarations produced by the Erlang parser to
generate random instances of records for testing purposes.)
It also means that dialyzer does not warn if e.g. an is_atom/1 test or
something more exotic like an atom_to_list/1 call is performed on the
value of the f1 field.
Similarly, there is no way to extend dialyzer to warn if it finds record
constructions where f1 is not initialized to some float.
Last but not least, it is semantically problematic when the type of the
field is an opaque type: creating a union of an opaque and a structured
type is very problematic for analysis because it fundamentally breaks
the opacity of the term at that point.
Change
-------
To solve these problems the parser will not automatically insert the
'undefined' value anymore; instead the user has the option to choose the
places where this value makes sense (for the field) and where it does
not and insert the | 'undefined' there manually.
Consequences of this change
----------------------------
This change means that dialyzer will issue a warning for all places
where records with uninitialized fields are created and those fields have
a declared type that is incompatible with 'undefined' (e.g. float()).
This warning can be suppressed easily by adding | 'undefined' to the
type of this field. This also adds documentation that the user really
intends to create records where this field is uninitialized.
|
|
The recently added module erl_anno can no longer handle
negative line numbers.
|
|
|
|
Fix the range type of erlang:abs/1.
|
|
Opaque recursive parameters are expanded faster.
|
|
Thanks to ILYA Khlopotov for pointing the bug out.
|
|
The example is provided by James Fish in
http://erlang.org/pipermail/erlang-questions/2014-December/082204.html.
Note that warnings with text such as "the _ variable breaks
opaqueness" are still possible.
|
|
Re-insert logic for `erlang:make_fun/3` in `erl_bif_types`. It had
been removed in bd941f5 while type spec-ing `erlang.erl`. Type spec in
`erlang.erl` cannot express arity of returned fun based on value of
argument hence re-introducing logic in `erl_bif_types`.
Re-definition of logic in `erl_bif_types` follows approach in 9d870a0.
|
|
|
|
|
|
Comparing two operands for (in)equality is allowed if both operands
are of the same unknown opaque type. Since OTP 17, there is a warning
if the types of the operands have nothing in common (this cannot
happen before OTP 17). However, the warning says there is a test
between opaque types, which is wrong. The warning now states that the
comparison cannot evaluate to 'true', which is more consistent.
|
|
In OTP 17 it is possible to mix types such as dict:dict() and
dict:dict(_, _) outside of the dict module (and similarly for some
other opaque types in STDLIB), but the results are unfortunately
possibly invalid warnings in users' code. In OTP 18 parameterized
opaque types with the same name but with different number of
parameters are no longer compatible when seen from outside of the
module where the types are declared.
The types in STDLIB have been updated accordingly; for instance
-opaque dict() :: dict(_, _).
has been replaced by
-type dict() :: dict(_, _).
|
|
The check that a modified type of a field is a subtype of the declared
type has been moved outside of the expansion of forms to avoid loops.
|
|
* Mention the option 'check_plt' among gui() options.
* No longer check a PLT twice when the analysis type is 'plt_check'.
* No longer raise a case_clause error when checking a PLT finds warnings.
Thanks to James Fish.
|
|
* aronisstav/dialyzer-inv-mult:
Fix a bug related to constraints generated for erlang:'*'/2
OTP-12725
|
|
For Rst = A1 * A2, typesig for erlang:'*'/2 was constraining the
arguments A1 and A2 in the 'reverse' direction by requiring that A2 is a
subtype of Rst div A1, unless A1 is a hard zero. This is not correct: if
for example both Rst and A1 are non_negative, such a constraint will
first force A1 to be non-zero for the division to go through and then
require A2 to be non_negative as non_negative div positive =
non_negative, always (see commited test).
In the fixed version, we are not constraining an argument if the other
operand *may* be zero.
|
|
|
|
Replace the undocumented option 'no_unknown' with the documented
option 'unknown'.
|
|
|
|
|
|
Thanks to James Fish for the bug report, and to Stavros Aronis for
fixing the bug.
|
|
The tests cannot be handled by earlier versions of Dialyzer.
|
|
In particular fix handling of records.
|
|
|
|
It is allowed in Erlang/OTP 17 to redefine the map() types. However,
Dialyzer did not handle local map() types correctly.
|
|
The -dialyzer() attribute can be used for suppressing warnings in a
module by specifying functions or warning options. It can also be used
for requesting warnings in a module.
|
|
|
|
* maint:
dialyzer: correct record updates
|
|
Correct a bug introduced in commit 8498a3.
|
|
After introducing maps for supervisor flags and child specs two tests
in behaviour_SUITE started failing:
behaviour_SUITE:custom_sup - failed because the type of the Period
(MaxT) property had been changed (corrected) from non_neg_integer() to
pos_integer() in the specification of the init callback in
supervisor.erl
behaviour_SUITE:supervisor_incorrect_return - same as above, plus the
introduction of #{} as possible value for the supervisor flags and
child_specs.
|
|
|