Commit Graph
2074 Commits
Author SHA1 Message Date
José Valim 480c19cb5b Respect keywords in access in code formatter 2021-05-11 12:37:58 +02:00
José Valim a5caf4bf56 Require Erlang/OTP 22+ 2021-05-06 19:20:14 +02:00
José Valim 5467b4e335 Remove TODOs related to Erlang/OTP 22+ 2021-05-06 19:14:26 +02:00
José Valim 7e2b22402c Do not ignore unimplemented function headers from used modules 2021-04-07 18:52:47 +02:00
José Valim 51de0e09a7 Add line numbers of first expression to lists 2021-03-30 11:08:44 +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 56ecdb172d Improve warnings 2021-03-26 13:19:04 +01:00
Wojtek Mach 4f533cf284 Fix ^^^ warning (#10814)
Bitwise.xor/2 -> Bitwise.bxor/2
2021-03-25 12:30:58 +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 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 6b2cc2332e Raise clearer error message on number followed by identifiers, closes #10755 2021-03-11 13:12:39 +01:00
José Valim 51d90f1932 Allow heredoc inside heredoc interpolation
Closes #10698
2021-03-10 16:03:24 +01:00
José Valim 8c29984ed1 Add :newline to unescape_map 2021-03-10 12:30:29 +01:00
José Valim c537c39c52 Validate dialyzer attributes, closes #10534 2021-03-10 11:13:41 +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 4098349cc5 Use proper comparison of otp_release 2021-02-24 16:00:00 +01:00
José Valim f0b227d401 No longer auto-sort bindings 2021-02-24 15:39:33 +01:00
José Valim 37b6b03efa Use maps as bindings on Erlang/OTP 24 for faster evaluation 2021-02-24 15:16:10 +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
Eksperimental b15a5ee95f Fix warning message mentioning quoted atoms may end with ! or ? (#10724) 2021-02-17 12:08:53 +01:00
Eksperimental 64224d8fe4 Use underscores in plural in warning messages (#10721) 2021-02-16 17:57:00 +01:00
José Valim 5db83370ed Generalize operator completion on IEx' parser 2021-02-12 14:19:31 +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
José Valim e5a2f71e1b Add System.trap_signal/3 and System.untrap_signal/2 (#10650) 2021-01-13 09:30:39 +01:00
José Valim 01f5196bf1 Properly handle keywords followed by ::, closes #10599 2021-01-02 17:41:16 +01:00
José Valim be394b34cc Also warn for literal structs on min/max 2020-12-18 17:55:29 +01:00
José Valim 53bbbc50b4 Do not warn for attributes used in after_compile
Closes #10579.
2020-12-17 13:05:02 +01:00
José Valim 75413fe127 Take \r\n into account when computing heredoc indentation 2020-12-06 15:20:50 +01:00
José Valim 0999441e77 Preserve CRLF for heredocs, closes #10504 2020-11-29 11:26:24 +01:00
José Valim e4137546a7 Do not raise when checking for ambiguity with static_atoms_encoder, closes #10501 2020-11-20 12:43:25 +01:00
José Valim 6320ee7953 Fix unused variable warning 2020-11-03 20:43:05 +01:00
José Valim 39c15699fe Simplify merge and check unused vars 2020-11-03 20:42:53 +01:00
José Valim 648ee98794 Deprecate System.stacktrace/0 across the language 2020-11-03 20:28:52 +01:00
Jonatan Männchen fc5fca1dad Propose pin operator with unused overridden variable (#10479)
When rebinding a variable that is not later used, the warning
proposes to use the pin operator.

Closes ##10478.
2020-11-03 20:28:46 +01:00
José Valim 03536e7c64 Prune tracers when fetching __ENV__ inside functions, closes #10466 2020-10-30 13:30:01 +01:00
Łukasz Samson b7375e59ca Add more information when behaviour_info/1 is called locally (#10446) 2020-10-20 16:36:07 +02:00
José Valim 82a1834bbe Warn when using special functions locally, closes #10444 2020-10-20 10:51:43 +02:00
José Valim 4bec4fa762 Do not crash if a module is given instead of file on inner compiler error 2020-10-20 10:51:43 +02:00
José Valim aa78b32291 Allow @on_load to be private, closes #10438 2020-10-17 20:08:06 +02:00
José Valim a042771ef2 Raise for is_record guards, closes #10436 2020-10-17 19:33:03 +02:00
José Valim 15d791547c Ignore tracers if lexical tracker is dead or explicitly nil 2020-10-11 00:15:25 +02:00
Milton Mazzarri ba0dc877ef Do not show warning when super is in GenServer.child_spec/1 (#10418)
The original goal[1] was to deprecate the usage of `super` on every `GenServer`
callback, but `child_spec/1` is not a callback, it's a default implementation
that can be re-implemented.

This commit removes the _deprecation warning_ when someone use `super` in
`GenServer.child_spec/1`.

Fixes: #10415

[1] https://github.com/elixir-lang/elixir/commit/c024b0eeb2dc69a759fe5ceeb1c8216d58ae9386#diff-ed0344c13ed25389035f337d94902894R301-R316
2020-10-10 23:31:05 +02:00
Gabriel Alves b2f561ef90 Raise instead of crashing on when trying to use list operators in guards (#10363) 2020-09-23 14:30:11 +02:00
Eksperimental 7dc2dd2e8e Rename struct attribute in defstruct (#10354)
Rename `@struct` to `@__struct__`.

Closes #10352
2020-09-20 20:26:25 +02:00