Commit Graph
5048 Commits
Author SHA1 Message Date
José Valim 08d3865fad Transform the struct update syntax into a type assertion
This transforms the struct update into a type assertion,
requiring the type system to be sure the expression has
precisely the given struct type.

The struct update syntax may still be deprecated in the
future but this will provide a safer migration path and
allow us to engage in more conversations with the community.
2025-06-25 19:30:04 +02:00
José Valim 54515bf48a Distinguish source_anno from doc_anno, see #14595 2025-06-21 03:54:44 -07:00
José Valim 9d4c91be2a Ensure block_keyword_or_binary_operator is handled in surround context, closes #14590 2025-06-21 03:25:36 -07:00
Guillaume Duboc cc9a5e7682 Simplified tuple definitions by removing negations (#14596) 2025-06-20 05:20:08 -07:00
Łukasz Samson b2587e8633 Handle error result from unescape_tokens in tokenizer (#14587) 2025-06-19 12:02:02 -07:00
Łukasz Samson 6ca0ad84b7 Consistently raise UnicodeConversionError in tokenizer (#14589) 2025-06-19 12:00:43 -07:00
Jean Klingler d59f49aa54 Mark inlined function call result as generated (#14581) 2025-06-14 19:05:31 +09:00
José Valim fb9a9e97d8 Allow captures to be reconstructed on type system pretty printing 2025-06-11 13:51:24 +02:00
José Valim e04444c42e Warn when invalid fun typespec is used 2025-06-11 12:08:45 +02:00
José Valim 5946e8bb9d Improve error message for bad/missing clauses, closes #14569 2025-06-10 14:38:30 +02:00
José Valim bff9f3ebbc Point out module must be required before macro usage in match/guard 2025-06-10 10:13:50 +02:00
José Valim ff4adca18a Filter @compile debug_info when explicitly set to true
Closes #14567.
2025-06-10 09:58:23 +02:00
José Valim 52495ba8bc Add tests for optional subtyping 2025-06-09 13:08:12 +02:00
José Valim 09dcbf7566 Introduce deprecations scheduled for Elixir v1.20 2025-06-07 21:55:06 +02:00
Jean Klingler 84d806603d More precise error message when escaping a regex with a ref (#14560)
* More precise error message when escaping a regex with a ref

* Refactor as do_quote_map_value

* Yet another refactoring proposal
2025-06-07 21:56:10 +09:00
José Valim b1053b75c5 Use binary appending now that we require Erlang/OTP 26
Prompt
======

There is a format/2 function in inspect/algebra.ex that
calls format/3 recursively that returns a list of binaries.
Instead of doing so, I want you to pass a binary as accumulator,
<<>>, and then instead of `[head | format(...)]`, on every
operation you will do `format(<<acc::binary, result::binary>>, ...)`.

Notes
=====

The assistant was able to detect an issue with `collapse/4`
but it was unable to fix it. That and the changes to
mix/tasks/format.ex were addressed manually.
2025-06-07 12:46:47 +02:00
José Valim b82d2dfa02 Reduce allocation on Inspect.Algebra by using cons cells 2025-06-07 09:57:36 +02:00
José Valim 56e7de39c0 Also pretty print structs with no fields in types 2025-06-05 17:39:49 +02:00
José Valim c6ed523914 Fix bugs and add completeness to function pretty printing 2025-06-05 09:18:32 +02:00
José Valim 7307f3c68d More tests for function application 2025-06-05 09:18:32 +02:00
José Valim f445cb98c3 Add CHANGELOG for function application and improve pretty printing 2025-06-03 10:53:06 +02:00
José Valim 4b6fdb40e8 Add more tests around compatibility check 2025-06-02 17:05:48 +02:00
José Valim 7819a73311 Simplify compatibility check 2025-06-02 16:53:06 +02:00
José Valim f6595985a5 Remove compile-time warnings 2025-06-02 16:17:15 +02:00
José Valim e87cc66041 Allow updated options to be returned from Inspect protocol (#14554) 2025-06-02 15:55:36 +02:00
José Valim 41d1a721ad Do not skip dynamic for indivisible types inside functions 2025-05-30 11:31:21 +02:00
José Valim 65e084e8f8 Infer types for fn 2025-05-30 11:31:21 +02:00
José Valim 0445e9d606 Add denormalization when pretty printing functions 2025-05-30 11:31:21 +02:00
José Valim a0d649cce9 Prove hints for empty domains from unions 2025-05-30 11:31:21 +02:00
José Valim c39286ef9c Improve error report and checks on function application (#14541) 2025-05-28 15:25:37 +02:00
José Valim 0a77a352ab More type checking of function applications (#14508) 2025-05-27 10:39:54 +02:00
José Valim fb19dec15c Include lines in == Compilation error in file ... == slogans (#14538)
Closes #14535.
2025-05-27 10:31:17 +02:00
Guillaume Duboc 17d51d11fb Add tuple elimination of negations (#14531) 2025-05-26 19:28:25 +02:00
Jean Klingler aa8672c4ee Improve test coverage of the Time module (#14525)
* Add tests for Time.to_iso8601/2

* Add tests for Time.compare/2 with different calendars

* Add tests for Time.diff/3

* Test Time.shift/2 with invalid values
2025-05-24 18:19:40 +09:00
Jean Klingler 8a13ed49e5 Improve test coverage of the Date module (#14524)
* Add tests for Date.utc_today/1

* Add test for non-integer duration shift

* Add test for Date.convert!/2 with incompatible calendars

* Add test for Date.diff/2 with incompatible calendars

* Add test for Date.compare/2 with incompatible calendars
2025-05-23 17:26:25 +02:00
Dmitry Kleymenov b4bcc3b32e Put error doctests to run pipeline (#14520) 2025-05-23 11:07:27 +02:00
José Valim 050f9e28b4 Run Erlang/OTP 28 on Windows CI (#14513) 2025-05-22 10:21:24 +02:00
José Valim 8de98a8a86 Raise nice error message when escaping maps/structs with references, closes #14497 2025-05-20 10:35:17 +02:00
José Valim 1f9433feaa not_a_map.key should raise BadMapError for consistency 2025-05-20 09:58:15 +02:00
José Valim f400ac9555 Mention patterns are not allowed in function heads
Closes #14496.
2025-05-20 09:00:33 +02:00
José Valim 36888adc07 Rely on more consistent return types for fun descr 2025-05-14 09:36:07 +02:00
José Valim 99b6e435ee Add tests for function to quoted 2025-05-12 18:14:21 +02:00
Guillaume Duboc df007f7a14 Add set-theoretic function types (#14369) 2025-05-12 17:13:45 +02:00
Jean Klingler dadbfade76 Rename function with typo: truthness -> truthiness (#14489) 2025-05-12 16:57:42 +09:00
Jean Klingler 465292fcf0 Fix CI failing coverage 2025-05-12 16:56:28 +09:00
Jean Klingler e9c85a4e47 Allow using protocol list implementation on improper lists (#14366)
* Allow using protocol list implementation on improper lists

* Regroup regression integration tests
2025-05-11 19:41:58 +09:00
Jean Klingler af29eeff77 Increase test coverage for Enum (#14473)
* Add test for Enum.slice with start > 0 and step > 0

* Cover more branches of sort internals
2025-05-07 16:20:47 +09:00
Jean Klingler 170b797b51 More test coverage for Enum for non-list inputs (#14471)
* Add tests for Enum.max/2 with empty fallback

* Add tests for Enum.min/2 with empty fallback

* Add tests for Enum.random/1 with streams or empty range

* Add tests for Enum.reduce/3 for streams & maps
2025-05-06 22:07:14 +09:00
Jean Klingler 36ac4fc843 Improve test coverage for Enum for non-list inputs (#14470)
* Add tests for Enum.count_until/2-3 with streams

* Add tests for Enum.empty?/1 with streams

* Add tests for Enum.flat_map/2 with streams

* Add tests for Enum.intersperse/2 with ranges
2025-05-06 20:57:44 +09:00
Jean Klingler 5c928c9153 Fix Regex.split/2 edge case with empty chunks (#14468) 2025-05-04 22:26:32 +09:00