Commit Graph
3938 Commits
Author SHA1 Message Date
José Valim 7e2b22402c Do not ignore unimplemented function headers from used modules 2021-04-07 18:52:47 +02:00
José Valim 415d4647c4 Remove invalid escaping of sigils, closes #10864 2021-04-02 23:14:38 +02:00
Eksperimental 91344a24a8 Format source code with new rules 2021-04-01 09:48:05 +02:00
Eksperimental 5fbdee2714 Quote range operator atom
This commit has only the actual changes
Add tests for quoted range operator
2021-04-01 09:48:05 +02:00
Kelvin Stinghen 7210ab2fbd Keeping underscore between digits on Macro.camelize/1 (#10843)
Closes #10839
2021-03-30 13:42:45 +02:00
Eksperimental 174b77150e Use one-based var names in Types (#10824)
In the same fashion as generated arguments 30373382ec
2021-03-30 13:42:41 +02:00
José Valim 203cb4bb6f Add Registry.values/3 2021-03-30 11:43:50 +02:00
José Valim 51de0e09a7 Add line numbers of first expression to lists 2021-03-30 11:08:44 +02:00
Eksperimental 2d40ad09d1 Simplify Range's step error message (#10835) 2021-03-29 23:34:55 +02:00
José Valim cd18fc7afd Remove Enum.zip_reduce_while, as it is equivalent to Stream.zip+Enum.reduce_while 2021-03-29 10:45:26 +02:00
José Valim b9474da3bf Bring zip optimizations for lists, add docs and specs 2021-03-29 09:56:47 +02:00
Adam Lancaster 7b4a57c35d Add zip_reduce and zip_reduce_while (#10828) 2021-03-29 09:33:36 +02:00
AndreOrlov 077b711d14 Fix KeyError custom message (#10829) 2021-03-28 18:59:22 +02:00
José Valim 251413a7b6 Adopt EEP 54
With EEP 54 (part of Erlang/OTP 24+), we can now get extra
information from Erlang errors. Before this patch:

    Interactive Elixir (1.12.0-dev)
    iex(1)> ets = :ets.new(:example, [])
    #Reference<0.3845811859.2669281281.223553>
    iex(2)> :ets.delete(ets)
    true
    iex(3)> :ets.insert(ets, :should_be_a_tuple)
    ** (ArgumentError) argument error
        (stdlib 3.15) :ets.insert(#Reference<0.3845811859.2669281281.223553>, :should_be_a_tuple)

After this patch:

    Interactive Elixir (1.12.0-dev)
    iex(1)> ets = :ets.new(:example, [])
    #Reference<0.105641012.1058144260.76455>
    iex(2)> :ets.delete(ets)
    true
    iex(3)> :ets.insert(ets, :should_be_a_tuple)
    ** (ArgumentError) errors were found at the given arguments:

      * 1st argument: the table identifier does not refer to an existing ETS table
      * 2nd argument: not a tuple

        (stdlib 3.15) :ets.insert(#Reference<0.105641012.1058144260.76455>, :should_be_a_tuple)

We choose to always track error info, instead of moving this
to blame, because it should be relatively cheap and it is
essential, especially when debugging live systems.
2021-03-27 11:52:21 +01:00
José Valim 3eb3a2e514 Better structure exception test 2021-03-27 11:31:23 +01:00
Wojtek Mach 09bf54014b Add step to Date.Range (#10816) 2021-03-26 15:03:24 +01:00
Wojtek Mach 9b44d9599f Fix Enumerable.Range.member?/2 with empty range (#10819) 2021-03-26 13:20:04 +01:00
Eric Meadows-Jönsson dedee1d85a Fix OTP 24 test warnings (#10817) 2021-03-25 17:41:04 +01:00
José Valim 895dc4f8e1 Properly underscore :rfc3986 2021-03-25 09:25:41 +01:00
José Valim bc187f37dc Support stepped ranges (#10810) 2021-03-25 07:32:06 +01:00
Wojtek Mach 3533144e8e Update warnings for OTP master (#10807) 2021-03-23 17:40:04 +01:00
José Valim d9a23d0d38 Deprecate ^^^ 2021-03-23 10:23:58 +01:00
José Valim 8df17a0891 Handle ambiguous unary op in keyword, closes #10806 2021-03-20 11:25:14 +01:00
José Valim 7d3a336980 Move parser tests to its own file and clean up private API 2021-03-20 11:20:37 +01:00
José Valim bc63b5fb80 Add ensure_compiled! to better handle deadlocks, closes #10802 2021-03-16 23:01:29 +01:00
José Valim 0a262ba86f Do not hide deadlocks between imports and structs, closes #10800 2021-03-16 17:47:53 +01:00
José Valim c5373b965e All @dialyzer module attributes also work for functions 2021-03-11 21:42:19 +01:00
José Valim 228502e2a8 All dialyzer module attributes are also function attributes 2021-03-11 21:37:17 +01:00
José Valim 6b2cc2332e Raise clearer error message on number followed by identifiers, closes #10755 2021-03-11 13:12:39 +01:00
José Valim d8d26e917a Warn on wrong dialyzer annotation to avoid breakage 2021-03-11 10:45:14 +01:00
José Valim 51d90f1932 Allow heredoc inside heredoc interpolation
Closes #10698
2021-03-10 16:03:24 +01:00
José Valim c537c39c52 Validate dialyzer attributes, closes #10534 2021-03-10 11:13:41 +01:00
José Valim a4ddf18871 Do not add compile time dependencies on @compile {:no_warn_undefined, _} 2021-03-08 09:39:32 +01:00
José Valim 5b3ae1b8c3 Rewrite not (foo in bar) to foo not in bar 2021-03-07 20:00:08 +01:00
José Valim 96661c6963 Show removal and deprecated tips from Erlang/OTP 2021-03-06 18:21:20 +01:00
José Valim bc0af62b21 Do not discard empty paths when merging, closes #10771 2021-03-06 09:30:30 +01:00
John Bampton 87f65c1e1d chore: remove unneeded whitespace (#10762) 2021-02-28 09:39:35 +01:00
José Valim f0b227d401 No longer auto-sort bindings 2021-02-24 15:39:33 +01:00
José Valim 73594085f2 Update erlang test helper 2021-02-24 09:50:48 +01:00
José Valim ad3dda75d6 Remove duplicated tests 2021-02-24 09:40:56 +01:00
Wojtek Mach b17d3a6cca Support 16bit floats in bitstrings (#10740)
On OTP 24:

    iex> <<x::float-16>> = <<60, 0>>
    iex> x
    1.0
    iex> <<x::float-16>>
    <<60, 0>>

Before OTP 24 we'd get errors or wouldn't match:

    iex> <<1.0::float-16>>
    ** (ArgumentError) argument error while evaluating iex at line 1

    <<x::float-16>> = <<60, 0>>
    ** (MatchError) no match of right hand side value: <<60, 0>>

    iex> (fn <<x::float-16>> -> x; _ -> :nomatch end).(<<60, 0>>)
    :nomatch
2021-02-20 11:24:58 +01:00
Jonathan Arnett 74e38a3e74 Mark is_struct/2 code as generated (#10734) 2021-02-17 21:00:04 +01:00
victor felder e95eea4bf2 Fix Macro.underscore for digit preceded by capitals, closes #10713 (#10715) 2021-02-14 22:30:19 +01:00
José Valim 4f59441490 Revert "Do not support negative dates on the basic format"
This reverts commit ce27b8348c.
2021-02-12 14:21:15 +01:00
Wojtek Mach 6437a1ad9f Update Erlang warnings translation (#10694)
Since https://github.com/erlang/otp/commit/8ecc648df22dbfe9dd68a3e2b968ba2b6a2ca7fe
instead of `{eval_failure, Reason}` we'd get `{eval_failure, Call, Reason}`
2021-02-12 12:23:58 +01:00
José Valim e5ba2261dc Add export dependencies on Macro.struct! 2021-02-11 10:58:18 +01:00
Christopher Keele 7c75d24aa2 Support basic datetime format in Calendar.ISO parsing functions (#10693) 2021-02-08 22:58:32 +01:00
Christopher Keele 8fa1bb5195 Rework Calendar.ISO parsing function tests and examples (#10692)
* Add ISO format examples to the top-level moduledocs.

* Move unit tests out of parse_time/1 documentation and into suite.

* Move unit tests out of parse_naive_datetime/1 documentation and into suite.

* Move unit tests out of parse_utc_datetime/1 documentation and into suite.

* Remove duplicated parse_date/1 doctests, fix missing asserts, other
cleanup.
2021-02-06 09:12:31 +01:00
José Valim ce27b8348c Do not support negative dates on the basic format 2021-02-05 07:55:22 +01:00
Eksperimental 2e3011bbe3 Fix context in defdelagate/2 AST (#10682)
Fixes #10593
2021-02-02 11:11:58 +01:00