aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src
AgeCommit message (Collapse)Author
2015-10-30Merge branch 'maint'Björn Gustavsson
* maint: beam_lib: Document all_chunks/1 and build_module/1
2015-10-22beam_lib: Document all_chunks/1 and build_module/1Björn Gustavsson
beam_lib:all_chunks/1 and beam_lib:build_module/1 can be useful for special-purpose stripping, for example to remove the "Line" chunk.
2015-10-08stdlib: Refactor the supervisor module's stateHans Bolinder
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.
2015-10-08Update Kernel and STDLIBHans Bolinder
Record field types have been modified due to commit 8ce35b2: "Take out automatic insertion of 'undefined' from typed record fields".
2015-10-08Take out automatic insertion of 'undefined' from typed record fieldsKostis Sagonas
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.
2015-10-08Merge branch 'maint'Zandra
2015-10-08Merge branch 'tomszilagyi/shell-support-del-home-end' into maintZandra
OTP-12032 * tomszilagyi/shell-support-del-home-end: Erlang shell: Support keys Del, Home and End
2015-10-02Merge branch 'maint'Zandra
2015-10-02Merge branch 'nybek/supervisor_reporting_error' into maintZandra
* nybek/supervisor_reporting_error: Fix supervisor reporting error
2015-09-21Merge branch 'bjorn/compiler/remove-deprecated/OTP-12979'Björn Gustavsson
* bjorn/compiler/remove-deprecated/OTP-12979: core_lib: Remove previously deprecated functions
2015-09-21Merge branch 'maint'Hans Bolinder
* maint: Update application versions
2015-09-18Update application versionsHans Bolinder
2015-09-18Merge branch 'maint'Dan Gudmundsson
* maint: stdlib: Fix leaking files after error_logger:logfile(close)
2015-09-18Merge branch 'dgud/stdlib/fix-file-error_log-leak' into maintDan Gudmundsson
* dgud/stdlib/fix-file-error_log-leak: stdlib: Fix leaking files after error_logger:logfile(close)
2015-09-17Merge branch 'maint'Henrik Nord
2015-09-17stdlib: Fix leaking files after error_logger:logfile(close)Dan Gudmundsson
Introduced when changing state from tuple to record.
2015-09-17Merge branch 'leoliu/export-catch_exception' into maintHenrik Nord
* leoliu/export-catch_exception: Export shell:catch_exception/1 as documented
2015-09-15stdlib: Remove deprecated functions in erl_parse and erl_scanHans Bolinder
The recently added module erl_anno can no longer handle negative line numbers.
2015-09-10core_lib: Remove previously deprecated functionsBjörn Gustavsson
2015-09-10Merge branch 'maint'Björn Gustavsson
* maint: stdlib: Fix bug with unicode detection in re
2015-09-10Merge branch 'howleysv/stdlib/compiled-unicode/OTP-12977' into maintBjörn Gustavsson
* howleysv/stdlib/compiled-unicode/OTP-12977: stdlib: Fix bug with unicode detection in re
2015-09-09stdlib: Fix bug with unicode detection in reShane Howley
Fix bug with unrecognised 'unicode' option in re:split/2,3 & re:replace/3,4 when using pre-compiled regex.
2015-09-09Merge branch 'maint'Hans Bolinder
* maint: dialyzer: Add a testcase Add documentation Introduce sasl_report_SUITE Teach sasl_report to limit crash reports proc_lib: Add format/3 Teach error_logger_tty_h to truncate big messages error_logger_tty_h: Refactor and modernize code Teach error_logger_file_h to truncate big messages error_logger_file_h: Refactor and modernize code Remove unused code in error logger handlers Add error_logger_h_SUITE sasl_SUITE: Add a rudimentary test of the utc_log configuration sasl_SUITE: Correct the log_file/1 test case proc_lib_SUITE: Remove added report handlers zip_SUITE: Don't trust priv_dir to be empty
2015-09-07proc_lib: Add format/3Björn Gustavsson
We'll need a way to limit the size of the crash report produced by proc_lib:format(). Add format/3, where the third argument is a depth argument.
2015-09-07Teach error_logger_tty_h to truncate big messagesBjörn Gustavsson
Add the possibility to truncate big messages to avoid running out of memory.
2015-09-07error_logger_tty_h: Refactor and modernize codeBjörn Gustavsson
Refactor, simplify, and modernize the code to facilitate future improvements in the following commits.
2015-09-07Teach error_logger_file_h to truncate big messagesBjörn Gustavsson
Add the possibility to truncate big messages to avoid running out of memory.
2015-09-07error_logger_file_h: Refactor and modernize codeBjörn Gustavsson
Refactor, simplify, and modernize the code to facilitate future improvements in the following commits.
2015-09-07Remove unused code in error logger handlersBjörn Gustavsson
A long time ago, errors from the emulator itself was sent as messages that would end up in the handle_info/2 function. Those clauses in handle_info/2 can be removed. The code for handling events tagged 'info' instead of 'info_msg' can also be taken out.
2015-08-26Merge branch 'maint'Dan Gudmundsson
* maint: Optimize zip:unzip/2 when uncompressing to memory wx: Fix assert log test debugger: Fix broken debugger:quick/3 start Remove erlang:now() and random usage in tests
2015-08-26Merge branch 'dgud/stdlib/zip-optimize/OTP-12950' into maintDan Gudmundsson
* dgud/stdlib/zip-optimize/OTP-12950: Optimize zip:unzip/2 when uncompressing to memory
2015-08-24Optimize zip:unzip/2 when uncompressing to memoryDan Gudmundsson
Optimize the case where we are appending to the end of the binary, use binary syntax to create binaries with room for expansion in the next loop, instead of using iolist_to_binary which creates a binary of the exact size and needs to be copied in each loop. Also remove support the unused Acc as iolists.
2015-08-21Merge branch 'maint'Hans Bolinder
* maint: stdlib: fix a qlc bug introduced in 18.0
2015-08-21stdlib: fix a qlc bug introduced in 18.0Hans Bolinder
As pointed out by roowe, qlc does not handle errors in early compiler (scanner, parser) well in OTP 18.0.
2015-07-16Erlang shell: Support keys Del, Home and EndTom Szilagyi
Add support for the Delete, Home and End keys in the Erlang shell. These keys are ubiquitous on modern keyboards. Having them working as expected adds to the convenience of working in the shell, since they are much easier to use than the corresponding Ctrl-{D,A,E} keys. The implementation is in line with the existing framework of the line editor and is thus a natural (and minimal) extension.
2015-07-10ose: Remove all code related to the OSE portLukas Larsson
The OSE port is no longer supported and this commit removed it and any changes related to it. The things that were general improvements have been left in the code.
2015-07-07Export shell:catch_exception/1 as documentedLeo Liu
2015-06-22fix errors caused by changed line numbersBruce Yinhe
2015-06-18Change license text to APLv2Bruce Yinhe
2015-06-16Merge branch 'nybek/fix_supervisor_get_childspec'Zandra Hird
* nybek/fix_supervisor_get_childspec: Fix supervisor:get_childspec/2 for simple_one_for_one OTP-12841
2015-06-16Merge branch 'ia/inets/deprecate'Ingela Anderton Andin
* ia/inets/deprecate: inets: Fix race condition in httpc inets: Remove use of httpd_conf:clean/1 and httpd_conf:custom_clean/3 inets: Remove use of httpd_conf:make_integer/1 inets: Deprecate functions in util module httpd_conf.erl
2015-06-15inets: Deprecate functions in util module httpd_conf.erlIngela Anderton Andin
These functions should not be used, there exists better functions in the standard libraries.
2015-06-15Merge branch 'sverk/ets-file2tab-preserve-opts/OTP-12814'Sverker Eriksson
* sverk/ets-file2tab-preserve-opts/OTP-12814: stdlib: Make ets:file2tab preserve read/write_concurrency stdlib: Fix ets_SUITE:tabfile_ext4
2015-06-15dialyzer: Modify the handling of parametrized opaque typesHans Bolinder
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(_, _).
2015-06-15stdlib: Make ets:file2tab preserve read/write_concurrencySverker Eriksson
2015-06-12stdlib: Introduce precedence for operators in typesHans Bolinder
Add new functions erl_parse:type_inop_prec() and erl_parse:type_preop_prec(). Get rid of paren_type used for parentheses in types.
2015-06-09Fix supervisor:get_childspec/2 for simple_one_for_oneRory Byrne
A bug in supervisor:get_childspec/2 results in {error, simple_one_for_one} being returned on every call when the supervisor strategy is simple_one_for_one. This commit includes a small refactoring which brings together the two 'start_child' clauses to make the code easier to follow.
2015-06-09Fix supervisor reporting errorRory Byrne
When a simple_one_for_one supervisor is shutting down, if one or more of its children fail to terminate within the 'shutdown' timeout, then the following reporting error will occur: * If there is only one child that fails to exit on time, then no supervisor report will be generated. * If more than one child fails to exit on time, then the reporting of 'nb_children' in the supervisor report will be 1 less than it should be.
2015-06-03Break out assert macros from eunit to stdlib assert.hrlRichard Carlsson
Several people have requested that the assert macros in EUnit should be moved out to a separate header file. This patch puts them in stdlib/include/assert.hrl, which gets included by the eunit.hrl file. Thus, nothing changes for eunit users, but the asserts can now also be included separately.
2015-06-02Merge branch 'josevalim/jv-annotate-form-type'Henrik Nord
* josevalim/jv-annotate-form-type: Annotate used types in erl_lint OTP-12800