Commit Graph
2538 Commits
Author SHA1 Message Date
José Valim 472c4e1a24 Avoid crashes on diagnostics with tabs, closes #14073 2024-12-16 12:09:18 +01:00
Jonatan Kłosko 1c7fc86e9c Make :source_path in docs chunk a charlist (#14071) 2024-12-13 16:57:54 +01:00
José Valim 4329a3c2f2 Address bootstrap 2024-12-13 10:01:18 +01:00
José Valim a78f1715dc Fix error message around single quote keywords 2024-12-10 19:30:39 +01:00
José Valim 71441623cc Update CHANGELOG and TODOs 2024-12-10 14:58:44 +01:00
José Valim 793c114721 Add JSON encoding and decoding (#14021) 2024-12-10 12:14:30 +01:00
Eksperimental eadbd8bdf3 Fix typos (#14023)
The typos were detected by this app: https://pypi.org/project/typos/
running the following command

    typos --exclude "lib/elixir/unicode/" --exclude "man/" --exclude "typos"  --format brief
2024-12-01 16:59:24 +01:00
José Valim 8eba863f8f Properly track stab inside container_cursor_to_quoted, closes #13826 2024-11-25 14:46:23 +01:00
José Valim bb028b951f Always consider Elixir modules on inference (#14000) 2024-11-19 13:40:16 +01:00
Jonatan Kłosko 8e1d0411ba Add token metadata to distinguish between :nil and nil (#13999) 2024-11-18 09:32:15 +01:00
Jonatan Kłosko 3b01b2a632 Add separate metadata entry for every block parens (#13996) 2024-11-15 13:55:22 +01:00
José Valim a7c8be77e6 Ensure one arity catch is always expanded to :throw 2024-11-14 11:16:38 +01:00
José Valim 52d6020787 Add functions to list of valid AST nodes
In theory we need to check if the function does not have
an environment but the goal of the check is not to be precise,
but rather to catch obvious mistakes.
2024-11-13 23:13:41 +01:00
José Valim bfebc1e30b Fix Dialyzer failures 2024-11-13 00:37:37 +01:00
José Valim 0182f7d146 Raise for undefined function within unused function 2024-11-12 23:19:41 +01:00
José Valim cb2e03688e Perform return type inference and application across local calls (#13984) 2024-11-11 23:06:31 +01:00
José Valim 485ca72ae2 Infer types and use them across remote calls (#13981)
This also unifies handling of deterministic builds with Erlang/OTP
as well as warnings_as_errors.
2024-11-09 18:00:27 +01:00
José Valim 9d1933b679 Use attributes field to compute behaviours 2024-11-08 12:33:08 +01:00
José Valim 57de6ea33a Type behaviour_info, module_info, and __info__ 2024-11-08 12:33:08 +01:00
José Valim f44aa8d710 Allow aliases and imports to be enabled conditionally in module body, closes #13975 2024-11-07 17:09:44 +01:00
José Valim 3146c4a71a Simplify metadata stored in ExCk chunk
The checker only runs on functions, so there is no need
to store macros. This reduces the amount of data serialized
and stored. In Livebook, it makes the group pass run about
30% faster.
2024-11-07 13:32:43 +01:00
Jonatan Kłosko 5b221a5545 Add AST metadata about assoc operator location (#13978) 2024-11-07 10:14:38 +01:00
Jonatan Kłosko 7d421b197c Add parens meta to stab operator and empty block (#13973) 2024-11-06 13:55:04 +01:00
José Valim c3dc6c86dd Detect never matching clauses and patterns (#13968) 2024-11-06 13:51:04 +01:00
José Valim 01474e0cd4 Type checking of try 2024-11-05 19:08:18 +01:00
Jonatan Kłosko d0f7c03744 Fix delimiter metadata for single quote atoms and remote calls (#13966) 2024-11-05 17:11:39 +01:00
Jonatan Kłosko ee90126527 Add delimiter meta to demote calls with quoted identifier (#13963) 2024-11-05 13:14:20 +01:00
Jonatan Kłosko e54b87c181 Fix formatter adding extra escapes to remote call functions (#13960) 2024-11-04 14:37:46 +01:00
Jean Klingler 5d626cb873 Improve validation of unquote_splicing AST (#13961) 2024-11-04 22:08:48 +09:00
Jonatan Kłosko bd7d428ca0 Add metadata about single-expression block closing/opening (#13940) 2024-11-03 10:20:44 +01:00
Jean Klingler cc68ad91cb Add shallow validation when unquoting AST (#13950) 2024-11-03 17:20:33 +09:00
José Valim 91e76d311c Keep compatibility with modules from archives 2024-10-30 19:38:39 +01:00
Jonatan Kłosko 1c19c60abb Add source and behaviour information to docs chunk metadata (#13914) 2024-10-30 09:18:00 +01:00
José Valim 5c29b7e73e Do not crash on preemptive errors with static atoms encoder, closes #13927 2024-10-30 08:31:06 +01:00
José Valim b5eb309e07 Fix clause rewriting in typing violations on apply 2024-10-30 07:20:25 +01:00
José Valim 809971a690 Remove redundant warnings 2024-10-29 18:52:12 +01:00
José Valim fce88ba5ca Use syntax allowed in Erlang/OTP 25 2024-10-28 22:48:06 +01:00
José Valim 16f1917c7a Fix bug in recursive variable detection 2024-10-28 22:21:41 +01:00
José Valim 8e455b7661 More type checking 2024-10-26 14:55:16 +02:00
José Valim c7fa5f95fc Add Macro.struct_info! 2024-10-26 09:21:04 +02:00
José Valim 860f485bdf Inference of patterns (#13909)
This pull request adds inference of patterns, being able to
refine types as new information is added. The next step is
to use this inference in the compiler itself.

Future work will add module-local inference of return types
(most likely still in v1.18) and inference of guards (most
likely in v1.19).

In order to support inference of patterns, Elixir will raise
if it finds recursive variable definitions. This means
patterns that never match, such as this one, will no longer
compile:

    def foo(x = {:ok, y}, x = y)

However, recursion of root variables (where variables directly
point to each other), will also fail to compile:

    def foo(x = y, y = z, z = x)

While the definition above could succeed (as long as all three
arguments are equal), there is a much cleaner version of writing
the same code, that does not require solving cycles in our head:

    def foo(x, x, x)
2024-10-18 11:01:23 +02:00
Jean Klingler e7ec9a0d08 prune_metadata keeps delimiters (#13911) 2024-10-17 15:38:22 +09:00
José Valim 35d7046f31 Move imported_quoted event to elixir_quote module 2024-10-06 21:10:32 +02:00
Jean Klingler f685a76c87 Fix another dialyzer Kernel.with edge case (#13869)
Close https://github.com/elixir-lang/elixir/issues/13868
2024-09-30 17:11:17 +09:00
Jean Klingler 4126cdd8ab Add --migrate flag to mix format (#13846) 2024-09-21 21:47:16 +09:00
Łukasz Samson 0e4aaf00c5 Correctly validate number of args for clauses with when in for and catch (#13785) 2024-08-19 12:22:33 +02:00
José Valim d9cf285d71 Enforce parens when formatting on more operators (#13711)
* On bitwise operators

* On right precedence operators which are semantically
  non-associative (such as -- and potentially ---)
2024-07-08 18:23:14 +02:00
José Valim 9924afff5d Remove highly restrictive scriptset support 2024-07-02 14:41:57 +02:00
Devin Alexander Torres f0fcd64f93 Inline more functions (#13692) 2024-06-25 15:13:17 +02:00
Jean Klingler 8ed692d4c9 Inline Version parse* functions when constant (#13690) 2024-06-25 22:11:35 +09:00