<feed xmlns='http://www.w3.org/2005/Atom'>
<title>otp.git/lib/dialyzer/test/behaviour_SUITE_data, branch KennethL-patch-1</title>
<subtitle>Mirror of Erlang/OTP repository.
</subtitle>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/'/>
<entry>
<title>dialyzer: Improve handling of Unicode</title>
<updated>2017-06-09T07:11:14+00:00</updated>
<author>
<name>Hans Bolinder</name>
<email>hasse@erlang.org</email>
</author>
<published>2017-05-30T13:53:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=6d80a38c876831aa141b58e757fbdf5663026f95'/>
<id>6d80a38c876831aa141b58e757fbdf5663026f95</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>stdlib: Make gen_server callbacks optional</title>
<updated>2017-04-21T12:52:48+00:00</updated>
<author>
<name>Zandra Norman</name>
<email>zandra@erlang.org</email>
</author>
<published>2017-01-23T10:49:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=8ca53b0f993ffbf2991e3068b76ec15b8f5eca51'/>
<id>8ca53b0f993ffbf2991e3068b76ec15b8f5eca51</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>dialyzer: Increase time limit for tests</title>
<updated>2017-02-01T08:14:57+00:00</updated>
<author>
<name>Hans Bolinder</name>
<email>hasse@erlang.org</email>
</author>
<published>2017-02-01T08:14:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=918eeb95d6d96ede31a85b07b008ae686dc0dfa8'/>
<id>918eeb95d6d96ede31a85b07b008ae686dc0dfa8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>dialyzer: Increase time limit of suites</title>
<updated>2016-08-31T13:34:54+00:00</updated>
<author>
<name>Hans Bolinder</name>
<email>hasse@erlang.org</email>
</author>
<published>2016-08-31T13:12:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=b593a4f25ee3c89b34152d96119bab981f102de6'/>
<id>b593a4f25ee3c89b34152d96119bab981f102de6</id>
<content type='text'>
The test 'proper' takes some time.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The test 'proper' takes some time.
</pre>
</div>
</content>
</entry>
<entry>
<title>dialyzer: Fix a bug in the translation of forms to types</title>
<updated>2016-04-29T12:16:38+00:00</updated>
<author>
<name>Hans Bolinder</name>
<email>hasse@erlang.org</email>
</author>
<published>2016-04-28T11:23:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=ce8162c18707fa860418118bc2f4be03719dff67'/>
<id>ce8162c18707fa860418118bc2f4be03719dff67</id>
<content type='text'>
A bug is fixed, but there are more problems.

Modify erl_types.erl like this:

  -define(EXPAND_LIMIT, 500).

and bogus warnings are output (again).

Callbacks and specs are compared (subtype) in dialyzer_behaviour. If
they are expanded to different depths, then invalid warnings can be
generated.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A bug is fixed, but there are more problems.

Modify erl_types.erl like this:

  -define(EXPAND_LIMIT, 500).

and bogus warnings are output (again).

Callbacks and specs are compared (subtype) in dialyzer_behaviour. If
they are expanded to different depths, then invalid warnings can be
generated.
</pre>
</div>
</content>
</entry>
<entry>
<title>Enhance map specs in erts, stdlib, runtime_tools</title>
<updated>2016-04-28T14:16:09+00:00</updated>
<author>
<name>Magnus Lång</name>
<email>margnus1@telia.com</email>
</author>
<published>2016-02-27T18:23:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=a13d4a750dfdf9a2a96d1e7ec0054644187afa59'/>
<id>a13d4a750dfdf9a2a96d1e7ec0054644187afa59</id>
<content type='text'>
Using the new type syntax, we can specify which keys are required, and
which are optional in a way Dialyzer could use.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Using the new type syntax, we can specify which keys are required, and
which are optional in a way Dialyzer could use.
</pre>
</div>
</content>
</entry>
<entry>
<title>erl_types: Add a map type representation</title>
<updated>2016-04-28T14:14:24+00:00</updated>
<author>
<name>Magnus Lång</name>
<email>margnus1@telia.com</email>
</author>
<published>2016-02-27T16:56:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=252df5612032cfba71285b5886937e88ba176529'/>
<id>252df5612032cfba71285b5886937e88ba176529</id>
<content type='text'>
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()=&gt;list()}       {[], integer(), list()}
    #{a=&gt;char(), b=&gt;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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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()=&gt;list()}       {[], integer(), list()}
    #{a=&gt;char(), b=&gt;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.
</pre>
</div>
</content>
</entry>
<entry>
<title>dialyzer: Remove t_parameterized_module/0 from erl_types</title>
<updated>2016-02-01T07:45:16+00:00</updated>
<author>
<name>Stavros Aronis</name>
<email>aronisstav@gmail.com</email>
</author>
<published>2015-11-23T14:00:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=6b2b36f3ef1a6715b971b81c03edf534a64c6c55'/>
<id>6b2b36f3ef1a6715b971b81c03edf534a64c6c55</id>
<content type='text'>
Parameterized modules are no longer supported, so module() can only be
an atom().
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Parameterized modules are no longer supported, so module() can only be
an atom().
</pre>
</div>
</content>
</entry>
<entry>
<title>Take out automatic insertion of 'undefined' from typed record fields</title>
<updated>2015-10-08T13:09:28+00:00</updated>
<author>
<name>Kostis Sagonas</name>
<email>kostis@it.uu.se</email>
</author>
<published>2015-05-07T12:43:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=6e93fb788aebb9050da2166749b41ff54197e049'/>
<id>6e93fb788aebb9050da2166749b41ff54197e049</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Update dialyzer test with maps in supervisor properties</title>
<updated>2014-11-06T13:48:00+00:00</updated>
<author>
<name>Siri Hansen</name>
<email>siri@erlang.org</email>
</author>
<published>2014-10-20T15:00:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.ninenines.eu/otp.git/commit/?id=c750756e5aeea78cc6f5570e3160113d96ba14db'/>
<id>c750756e5aeea78cc6f5570e3160113d96ba14db</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
</feed>
