Age | Commit message (Collapse) | Author |
|
|
|
|
|
The field 'dynamics' in #state{} is a union of two opaque types, which
is possibly problematic. Tagging the types should make the code safe
for warnings from future versions of Dialyzer.
|
|
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.
|
|
|
|
OTP-12032
* tomszilagyi/shell-support-del-home-end:
Erlang shell: Support keys Del, Home and End
|
|
|
|
* nybek/supervisor_reporting_error:
Fix supervisor reporting error
|
|
=== OTP-18.1 ===
Changed Applications:
- compiler-6.0.1
- crypto-3.6.1
- debugger-4.1.1
- dialyzer-2.8.1
- diameter-1.11
- erts-7.1
- eunit-2.2.11
- hipe-3.13
- inets-6.0.1
- kernel-4.1
- mnesia-4.13.1
- odbc-2.11.1
- public_key-1.0.1
- sasl-2.6
- ssh-4.1
- ssl-7.1
- stdlib-2.6
- tools-2.8.1
- wx-1.5
Unchanged Applications:
- asn1-4.0
- common_test-1.11
- cosEvent-2.2
- cosEventDomain-1.2
- cosFileTransfer-1.2
- cosNotification-1.2
- cosProperty-1.2
- cosTime-1.2
- cosTransactions-1.3
- edoc-0.7.17
- eldap-1.2
- erl_docgen-0.4
- erl_interface-3.8
- et-1.5.1
- gs-1.6
- ic-4.4
- jinterface-1.6
- megaco-3.18
- observer-2.1
- orber-3.8
- os_mon-2.4
- ose-1.1
- otp_mibs-1.1
- parsetools-2.1
- percept-0.8.11
- reltool-0.7
- runtime_tools-1.9.1
- snmp-5.2
- syntax_tools-1.7
- test_server-3.9
- typer-0.9.9
- webtool-0.9
- xmerl-1.3.8
Conflicts:
OTP_VERSION
erts/vsn.mk
|
|
|
|
* bjorn/compiler/remove-deprecated/OTP-12979:
core_lib: Remove previously deprecated functions
|
|
* maint:
Update application versions
|
|
|
|
* maint:
stdlib: Fix leaking files after error_logger:logfile(close)
|
|
* dgud/stdlib/fix-file-error_log-leak:
stdlib: Fix leaking files after error_logger:logfile(close)
|
|
|
|
Introduced when changing state from tuple to record.
|
|
* leoliu/export-catch_exception:
Export shell:catch_exception/1 as documented
|
|
* maint:
stdlib: Update application version
|
|
|
|
The recently added module erl_anno can no longer handle
negative line numbers.
|
|
|
|
* bjorn/cuddle-with-tests: (23 commits)
rand_SUITE: Speed up basic_stats/1
base64_SUITE: Speed up roundtrip/1
lists_SUITE: Test lists:concat/2
lists_SUITE: Test lists:split/2
lists_SUITE: Add a test case for lists:prefix/2
lists_SUITE: Add hof/1 to test all high-order functions
lists_SUITE: Add test for lists:takewhile/1
lists_SUITE: Run test cases in each group in parallel
lists_SUITE: Test lists:keyreplace/4
lists_SUITE: Extend flatten/1 test to also test flatlength/1
lists_SUITE: Correct test of lists:flatten/2
id_transform_SUITE: Modernize test suite
io_proto_SUITE: Speed up determination of default shell
io_proto_SUITE: Refactor up rtnode() and friends
gen_event_SUITE: Remove unnecessary sleep calls
proc_lib: Improve coverage for crash/1
proc_lib_SUITE: Eliminate compiler warnings
io_SUITE: Add coverage/1 to completely cover io_lib_pretty
io_SUITE: Extend coverage of code for testing printable chars
io_SUITE: Speed up test for bad +pc option
...
|
|
Refactor basic_stats/1 into three separate test cases that can be
run in parallel.
|
|
Refactor roundtrip/1 into 4 test cases that can be run in parallel.
Assuming that there are 4 cores available, the group of 4 test
cases will run at roughly one fourth of the time for the original
test case.
|
|
|
|
|
|
|
|
|
|
|
|
On my computer, this will shave off more than one second of the
runnning time and about 4 seconds when cover is being run.
|
|
|
|
|
|
The test that was supposed to call lists:flatten/2 called
lists:flatten/1!
|
|
Remove handling of Clearcase; remove ?line macros.
|
|
Use getline_pred action that fails fast if the shell is not
the oldshell, to avoid having to wait for the timeout.
|
|
Introduce a new {getline_pred, Fun, Msg} action that is useful
in itself, but can also be used to share more code for
{getline, Match} and {getline_re, Match}.
Also get rid of the ?line macros in rtnode() so that we can
somewhat reduce the ridculous indentation level.
|
|
The calls to test_server:sleep/1 are unnecessary as the swapping
of handlers happens in a single process. Even though the
{swap_info,...} message is sent asynchronously, the
gen_event:which_handlers/1 call will not have a chance to
execute until the handlers have been swapped.
|
|
First refactor the entire test case using helper functions
to facilitate further maintenance. Then test that proc_lib
can handle that the process dictionary has been erased
(that will cover more code in proc_lib).
We can also shave off 2 seconds of the execution time by
testing the 'shutdown' exit reasons at beginning of the
test case instead of doing it at the end.
|
|
Use error/1 instead of forcing a badmatch.
|
|
|
|
|
|
Move the test for a bad +pc option to its own test case for
cleanliness. Use the os:cmd/1 function to avoid the annyoying
30 seconds time-out in test_server:start_node/3.
|
|
|
|
* siri/doc-gen_fsm-reply-return/OTP-12973:
Fix doc for return value of gen_fsm:reply/2
|
|
|
|
* maint:
stdlib: Fix bug with unicode detection in re
|
|
* howleysv/stdlib/compiled-unicode/OTP-12977:
stdlib: Fix bug with unicode detection in re
|
|
|