Commit Graph
2043 Commits
Author SHA1 Message Date
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
José Valim b1d9f3da66 Return an empty map instead of none for public but undocumented functions 2020-09-18 11:59:44 +02:00
José Valim 3d43d93d45 Infer -> Unify 2020-09-14 13:32:13 +02:00
José Valim 8167bb65d1 Move struct handling from unify to AST (#10320)
We also improve error messages to list all
available fields and introduce Module.Types.Of
module to hold shared functionality between Expr
and Pattern.
2020-09-11 19:51:46 +02:00
José Valim b52ddb30e0 Move Checker into ParallelChecker 2020-09-10 20:04:10 +02:00
José Valim 9b388a58a1 Reuse logic on exception blame and types errors 2020-09-10 15:46:09 +02:00
Eric Meadows-Jönsson ef0f17dfe5 Improve map unification (#10310) 2020-09-10 12:37:43 +02:00
sabiwara 1fca074184 Fix &//2 parsing issue (#10312) 2020-09-10 09:20:07 +02:00
José Valim 749459a32f Merge remote with inference pass (#10305) 2020-09-08 09:08:44 +02:00
José Valim e3344123c2 Do not propagate tracers to dynamic definitions, closes #10271 2020-08-18 20:06:44 +02:00
Eksperimental df449805c8 Revise use of Note and Notice verbs (#10264) 2020-08-14 07:59:34 +02:00
José Valim e1e8f9afec Add column information to SyntaxError and TokenMissingError 2020-08-12 20:14:31 +02:00
José Valim afa6d0c177 Add test for invalid tokenizer expressions 2020-08-12 14:18:13 +02:00
Eksperimental 512594c08a Mention file:line in Already defined as ... error message (#10219) 2020-07-22 14:59:37 +02:00
José Valim 92cf894756 Require a trailing underscore to consider it a compiler variable 2020-07-17 13:59:52 +02:00
Fernando Tapia Rico fc6bf59462 Add List.Chars to bootstrap modules
If there is a compile error, Kernel.ParallelCompiler raises
`** (UndefinedFunctionError) function List.Chars.to_charlist/1 is
undefined (module List.Chars is not available)`.
2020-07-16 13:20:38 +02:00
José Valim 6228ade7d2 Do not warn if quotes are used on complex atoms
Atoms that have non-ascii characters or @ does not
require tokens. That's to streamline the developer
experience around examples :"foo@computer-name" and
:"hélló".
2020-07-15 20:10:31 +02:00
José Valim 08706cc490 Warn if a variable that looks like a compiler variable is unused (#10198)
Closes #10197.
2020-07-15 12:20:49 +02:00
José Valim 7aa93b188c Improve compiler error message when using | in a def pattern 2020-07-11 10:22:28 +02:00
José Valim 089d0cd6b6 Use macros instead of special casing in the compiler 2020-07-01 15:49:14 +02:00
José Valim 0166ee82a1 Do not read from ExCk chunk if not necessary
Since all information is in the debug chunk, we use
that instead. This also allows us to remove
`no_warn_undefined` from the ExCk chunk.
2020-06-25 15:34:46 +02:00
José Valim e51cc8b88c Also track exports API via local deps 2020-06-25 15:09:14 +02:00
José Valim 8b4ec95a99 Revert "Consistently handle empty blocks"
Actually, we don't allow `-> [EMPTY]` anywhere else.

This reverts commit 3c6891cb7d.
2020-06-25 12:32:07 +02:00
José Valim 3c6891cb7d Consistently handle empty blocks 2020-06-24 20:48:05 +02:00
José Valim 9a6db666a1 Do not make requires/imports compile-time dependencies
Previously, imports and requires were always added as
compile-time dependencies. With this change, they are
"export" dependencies, which are dependencies that depend
on the API defined by a module, such as struct and its
public definitions.

This change should drastically remove the amount of
modules recompiled in Elixir, making imports more feasible
for large projects.
2020-06-24 14:30:00 +02:00
Ioannis Pinakoulakis 6666b7bb31 Typos on the erlang files (#10118) 2020-06-21 11:14:11 +02:00
Kelvin Stinghen 83374a88c9 Rewording the default arguments warnings (#10097) 2020-06-13 11:28:09 +02:00
José Valim cc138f37f2 Add line numbers to deprecated imports 2020-06-11 15:59:07 +02:00
José Valim 0df37749af Use reserved word where appropriate instead of token/keyword 2020-06-11 10:34:50 +02:00
José Valim 0bbcb8f280 Add is_map_key as a function that returns booleans 2020-06-07 17:27:12 +02:00
José Valim 4fea9cc942 Recompile Kernel before bootstrapping stdlib (#10002)
Before this patch, we could have slightly different
AST while compiling modules in parallel, depending
if modules were recompiled or not. Now we always
recompile Kernel before compiling the whole stdlib.

We used this opportunity to simplify bootstrap by
breaking it two steps. The first step is the minimal
necessary to compile Kernel itself. The second step
contains the whole compiler.

Closes #10000.
2020-04-30 01:38:04 +02:00
José Valim 8bcbfe9a87 Do not send keyword through static_atoms_encoder, closes #9996 2020-04-29 11:09:05 +02:00