aboutsummaryrefslogtreecommitdiffstats
path: root/lib
AgeCommit message (Collapse)Author
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_parse: Add parsing for new map type syntaxMagnus Lång
erl_types typesets mandatory keys with :=, and uses "..." as a shorthand for "any() => any()". Add these to erl_parse so that all representable types can be written in type-specs.
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-28Merge branch 'egil/maps-api-additions/PR-1025/OTP-13522'Björn-Egil Dahlberg
* egil/maps-api-additions/PR-1025/OTP-13522: stdlib: Document maps:update_with/3,4 stdlib: Add tests for maps:update_with/3,4 stdlib: Add maps:update_with/3,4 erts: Add tests for maps:take/2 stdlib: Document maps:take/2 erts: Add BIF maps:take/2
2016-04-28Merge branch 'bjorn/compiler/cuddle-with-tests'Björn Gustavsson
* bjorn/compiler/cuddle-with-tests: compilation_SUITE: Use explicit exports Remove support for running tests on a separate Erlang node Move code from compilation_SUITE to beam_block_SUITE Move list comprehension tests to lc_SUITE Move catch tests to trycatch_SUITE Remove compilation_SUITE:long_string/1 Move pattern-matching tests to match_SUITE Remove toothless test compile_SUITE:missing_testheap/1 misc_SUITE: Add missing export of integer_encoding/0 Move test cases from compilation_SUITE to beam_utils_SUITE Move complex_guard/1 from compilation_SUITE to guard_SUITE Remove compilation_SUITE:guards/1 Move tests from compilation_SUITE to record_SUITE Move bit syntax test cases from compilation_SUITE to bs_match_SUITE Remove useless test case compilation_SUITE:otp_2141/1 compilation_SUITE: Run the Core linter for all compilations
2016-04-27stdlib: Document maps:update_with/3,4Björn-Egil Dahlberg
2016-04-27stdlib: Add tests for maps:update_with/3,4Björn-Egil Dahlberg
2016-04-27stdlib: Add maps:update_with/3,4Björn-Egil Dahlberg
Maps equivalent to dict:update/3,4
2016-04-27stdlib: Document maps:take/2Björn-Egil Dahlberg
2016-04-27compilation_SUITE: Use explicit exportsBjörn Gustavsson
With 'export_all' it is easy to add a new test case function and forget to add its name to the list of test cases to run. While we are it, remove unused functions and add the forgotten test case on_load_inline/1.
2016-04-27Remove support for running tests on a separate Erlang nodeBjörn Gustavsson
It has not been used for ages.
2016-04-27Move code from compilation_SUITE to beam_block_SUITEBjörn Gustavsson
2016-04-27Move list comprehension tests to lc_SUITEBjörn Gustavsson
2016-04-27Move catch tests to trycatch_SUITEBjörn Gustavsson
2016-04-27Remove compilation_SUITE:long_string/1Björn Gustavsson
long_string/1 was written to test that long string were handled efficiently in beam_asm. Strings used to be stored in the string table chunk, but are currently literals. There does not seem that this test case is likely to find any bugs.
2016-04-27Move pattern-matching tests to match_SUITEBjörn Gustavsson
2016-04-27Remove toothless test compile_SUITE:missing_testheap/1Björn Gustavsson
missing_testheap/1 is no longer relevant for the following reasons: 1) Because of the literal pool introduced in R12, no test_heap instructions are needed in the guards. 2) beam_validator would abort the compilation if any needed test_heap instructions were missing.
2016-04-27misc_SUITE: Add missing export of integer_encoding/0Björn Gustavsson
The integer_encoding/1 test is supposed to be run with a tighter timetrap ensure that encoding of integer in BEAM files is efficient enough.
2016-04-27Move test cases from compilation_SUITE to beam_utils_SUITEBjörn Gustavsson
beam_utils_SUITE didn't exist when the two test cases were written.
2016-04-27Merge branch 'xumingthepoet/maint/PR-1008/OTP-13516'Zandra
* xumingthepoet/maint/PR-1008/OTP-13516: Update global_group_SUITE.erl Fix global_group.erl
2016-04-27Merge branch 'maint-18'Henrik Nord
Conflicts: OTP_VERSION lib/ssl/doc/src/ssl.xml lib/ssl/src/ssl_cipher.erl lib/ssl/src/tls_v1.erl lib/ssl/test/ssl_basic_SUITE.erl
2016-04-27Move complex_guard/1 from compilation_SUITE to guard_SUITEBjörn Gustavsson
2016-04-27Remove compilation_SUITE:guards/1Björn Gustavsson
Obsoleted by guard_SUITE (especially literal_type_tests/1).
2016-04-27Move tests from compilation_SUITE to record_SUITEBjörn Gustavsson
2016-04-27Move bit syntax test cases from compilation_SUITE to bs_match_SUITEBjörn Gustavsson
We used to put code that would crash the compiler into compilation_SUITE_data. That way we would have a failing test case to remind us to fix a bug. Nowadays, we generally fix the bug and write the test case at the same time. Therefore it makes more sense to put the test code directly into a test suite. Move out bin_syntax_1 through bin_syntax_5 test cases. Scrap bin_syntax_6 because it does not longer seems to be relevant. While we are it, rename the fun_shadow/1 test to size_shadow/1. Also make sure that the code produces the correct result.
2016-04-27Remove useless test case compilation_SUITE:otp_2141/1Björn Gustavsson
2016-04-27compilation_SUITE: Run the Core linter for all compilationsBjörn Gustavsson
2016-04-27Merge branch 'raimo/polish-gen_statem/OTP-13065'Raimo Niskanen
* raimo/polish-gen_statem/OTP-13065: Fix hibernation subtlety
2016-04-27Fix hibernation subtletyRaimo Niskanen
2016-04-26Update global_group_SUITE.erlxuming
2016-04-26Fix global_group.erlxuming
2016-04-26Remove extra ">" in exampleseksperimental
2016-04-26Update release notesErlang/OTP
2016-04-26Merge branch 'ingela/inets/http_server-ssl-peer-cert/OTP-13510' into maint-18Erlang/OTP
* ingela/inets/http_server-ssl-peer-cert/OTP-13510: inets: Prepare for release inets: Add peer_cert to ESI environment
2016-04-26Merge branch 'ingela/ssl/config-signature-algs/OTP-13261' into maint-18Erlang/OTP
* ingela/ssl/config-signature-algs/OTP-13261: ssl: Prepare for release ssl: Add option signature_algs
2016-04-26Merge branch 'lukas/ts/exit_status/OTP-13515'Lukas Larsson
* lukas/ts/exit_status/OTP-13515: ts: Add logging of exit_status from test node
2016-04-25Merge branch 'raimo/new-gen-state-machine/OTP-13065'Raimo Niskanen
* raimo/new-gen-state-machine/OTP-13065: (52 commits) Add section on state filtering Promote gen_statem over gen_fsm Modify code_change/4 to return CallbackMode Use ?NAME macro in examples Introduce Fred Herbert suggested additions Introduce corrections from Fred Hebert and Ingela Use .png pictures instead of .gif Write Design Principles chapter Fix missing short forms for event timeout Do more intricate Fred Hebert doc changes Change Caller -> From as suggested by Fred Hebert Do documentation improvements from Fred Hebert Fix broken documenation reference Rename state_timeout -> event_timeout Fix most of the system docs and emacs mode Change code_change/4 to {ok,State,Data} Fixup sharpened test suite Sharpen test suite Remove the remove_event action and all alike Relax caller() type check and cleanup ... Conflicts: lib/stdlib/src/gen.erl lib/stdlib/src/gen_event.erl lib/stdlib/src/gen_fsm.erl lib/stdlib/src/gen_server.erl lib/stdlib/test/error_logger_forwarder.erl
2016-04-25Merge branch 'egil/runtime_tools/modernize-tests'Björn-Egil Dahlberg
* egil/runtime_tools/modernize-tests: Eliminate use of doc and suite clauses Replace ?t with test_server Replace use of test_server:format/2 with io:format/2 Eliminate use of test_server:fail/0,1 Eliminate use of ?config() macro Modernize use of timetraps Remove ?line macros
2016-04-25Merge branch 'ingela/master/ssl/3-4-tuples-cipher-suites-mix/OTP-13511'Ingela Anderton Andin
* ingela/master/ssl/3-4-tuples-cipher-suites-mix/OTP-13511: ssl: Corrections to cipher suite handling
2016-04-25inets: Add peer_cert to ESI environmentIngela Anderton Andin
2016-04-25ssl: Corrections to cipher suite handlingIngela Anderton Andin
It was not possible to mix ssl 3 and 4 tuple cipher suites in the ciphers option. Some ssl_cipher:suite/1 clauses wrongly returned 3-tuples that should have been 4 tuples Conflicts: lib/ssl/test/ssl_basic_SUITE.erl
2016-04-25stdlib: Remove use of crypto:rand_bytes/1Ingela Anderton Andin
The use case is not cryptographical but we want to compare Erlang implementation to c implementation so use crypto:strong_rand_bytes anyway.