Commit Graph
3956 Commits
Author SHA1 Message Date
Eksperimental 9b1aea3912 Add catch-all clause to Protocol.callback_ast_to_fa/1 (#10936) 2021-04-21 17:32:03 +02:00
Eric Meadows-Jönsson d931b1ed0b Check function calls in guards (#10820) 2021-04-20 18:37:26 +02:00
José Valim f248a52183 Code.cursor_context/2 (#10915) 2021-04-20 11:45:00 +02:00
Eksperimental 72abef4e2f Fix case when callback spec uses when clause (#10927)
This was causing an error:
** (FunctionClauseError) no function clause matching in Protocol.callback_ast_to_fa/1

Introduced in PR: #10912, commit: 485cc13946
2021-04-19 21:15:40 +02:00
José Valim 5ddd5f37bd Improve undefined function compilation errors 2021-04-18 08:58:20 +02:00
Eksperimental 485cc13946 Warn if @callback, @macrocallback and @optional_callbacks defined inside protocol (#10912)
Closes #10901
2021-04-17 22:20:42 +02:00
José Valim 843587723f Do not crash on Path.absname(c:) (#10919) 2021-04-17 22:05:39 +02:00
Dave Cottlehuber 3f4ee226df Improve URI docs & tests for IPv6 literals (#10896) (#10902)
The URI module is not quite in compliance with the canonical RFC3986,
when handling IPv6 literal hostnames. These should be stored with
`[]` included. This is handled correctly in the authority field, but
not in the hostname field.

We can't change this behaviour now, so add doc & test.
2021-04-14 11:53:16 +02:00
Eksperimental b4e270354b Fix optional callback blame hint (#10893)
Previously it was wrongly hinting that the
behaviour Behaviour expected a private or undefined function to be present,
when the callback was optional.
2021-04-12 09:21:58 +02:00
sabiwara 06f155eb49 Fix regression in Enum.dedup/1 (#10886) 2021-04-09 13:18:05 +02:00
José Valim eb34806cf3 Allow default inspect fun to be set globally (#10859) 2021-04-09 12:48:32 +02:00
José Valim 464db07b31 Do not ignore unimplemented function headers from used modules 2021-04-07 18:52:38 +02:00
José Valim f6ed9fa2b8 Simplify rules and error messages 2021-04-06 16:52:34 +02:00
Eksperimental b0c09c81b4 Improve error message with invalid call at several locations (#10879) 2021-04-05 17:06:06 +02:00
Eksperimental 2424fe8a00 Make message in error suggestion generic for ones or more suggestions (#10878) 2021-04-05 17:05:10 +02:00
Eksperimental 03829be0c0 Standardize use of Erlang/OTP VERSION (#10867) 2021-04-03 17:11:57 +02:00
José Valim 88d82f0597 Remove invalid escaping of sigils, closes #10864 2021-04-02 23:12:43 +02:00
José Valim 587c80eae6 Make get_in consistent with pop_in and abort on nils 2021-04-02 19:42:11 +02:00
Eksperimental 70d740daec Format source code with new rules 2021-04-01 09:46:47 +02:00
Eksperimental d22060f91f Quote range operator atom
This commit has only the actual changes
Add tests for quoted range operator
2021-04-01 09:46:47 +02:00
Eksperimental 9e9f95c30c Replace deprecated random seed algorigthm in tests (#10849)
Use :exss exclusively since it is the default one in OTP 22+
2021-03-30 18:39:54 +02:00
Kelvin Stinghen 9c39d46e54 Keeping underscore between digits on Macro.camelize/1 (#10843)
Closes #10839
2021-03-30 13:42:09 +02:00
Eksperimental bc842510dc Use one-based var names in Types (#10824)
In the same fashion as generated arguments 30373382ec
2021-03-30 12:58:58 +02:00
José Valim 96b9be6424 Add Registry.values/3 2021-03-30 11:43:16 +02:00
José Valim cb1e64e6cc Add line numbers of first expression to lists 2021-03-30 11:07:46 +02:00
Eksperimental f734aac922 Simplify Range's step error message (#10835) 2021-03-29 23:34:25 +02:00
Eksperimental e6ffd5c232 Remove Integer.to_string/1 and Integer.to_charlist/1 (#8777)
They are not needed, since they are covered by their /2 version.
2021-03-29 17:53:19 +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