Commit Graph
5494 Commits
Author SHA1 Message Date
José Valim 7427c0cf5d A binary may always be returned in a comprehension, closes #15857 2026-09-07 16:24:15 +02:00
preciz 269b4a334b Detect disjoint maps with any required unmatched field
A required unmatched key cannot occur in the other closed map, even when
the remaining unmatched keys include optional fields. Recognize this
case early to avoid retaining unnecessary BDD nodes during subtraction.

Assisted-by: Codex:GPT-6
2026-09-05 18:42:08 +02:00
José Valim 2e9ce85e91 Fix precedence when parsing unary ops with do-end blocks
Closes #15849. Closes #15851.
2026-09-05 10:04:11 +02:00
Jean Klingler 4a74923ebb Minor improvements to invalid struct key error (#15852) 2026-09-05 16:48:42 +09:00
Barna Kovacs 82b1360aa4 Optimize Enum.min_max/1,2 for non-empty lists (#15845)
Assisted-by: Antigravity:Gemini-3.7-Flash
2026-09-05 00:38:34 +02:00
Alexander Gubarev b0d02d3965 Fix macro dbg/3 ignores ANSI color setting (#15842) 2026-09-04 08:34:50 +02:00
Barna Kovacs fdebc8cba6 Optimize Date.Range.member?/2 by branching on step sign (#15838)
Branching on the step sign rather than `first_days <= last_days` eliminates
the need for `empty?/1` because the interval bounding checks inherently
guarantee non-emptiness. This aligns `Enumerable.Date.Range` with
`Enumerable.Range`, eliminates a private function call per membership
check, and removes 27 lines of redundant code.

Assisted-by: Antigravity:Gemini-3.7-Flash
2026-09-03 14:06:38 +02:00
Łukasz Samson a5cfa254a3 Fix unsound refinement of min/2 and max/2 arguments (#15835)
Do not refine both operands from the result expectation because either operand may be discarded by term ordering. Apply the expectation only to the result and cover escaping operand bindings.

Assisted-by: Codex:GPT-5
2026-09-03 10:08:45 +02:00
Jhan S. Álvarez aba75ca1b2 Add Macro.quoted_literal? clause for __block__ wrapped literals (#15836) 2026-09-03 09:29:08 +02:00
Alexander Gubarev d4b2c58979 Improve defstruct @enforce_keys (#15826) 2026-09-02 21:34:39 +02:00
José Valim 3a21a6a50a Do not accept empty tuples in several tuple functions, closes #15817 2026-09-01 01:01:24 +02:00
Alexander Gubarev 4fbdbc8acd Fix functions with impossible clauses typecheck crash (#15794) 2026-08-31 17:56:45 +02:00
Alexander Gubarev 9e2f0ff348 Improve message for typespecs stepped ranges (#15816) 2026-08-31 17:32:19 +02:00
Alexander Gubarev 7bd7665a9b Fix DateTime convert/2 and truncate/2 ignoring custom calendar from map (#15814) 2026-08-31 15:54:35 +02:00
José Valim 1eff1acffd Fix recursion on charlist error path 2026-08-28 12:28:08 +02:00
Łukasz Samson dc939db4ad Refine map key checks for literal keys (#15804)
Assisted-by: Codex:GPT-5
2026-08-28 11:19:50 +02:00
Łukasz Samson b945cee1a9 Make singleton-typed pin patterns precise (#15805)
Assisted-by: Codex:GPT-5
2026-08-28 11:19:33 +02:00
Łukasz Samson 5779f5be37 Widen stacktrace extra info types (#15798)
Match OTP's stacktrace contract in __STACKTRACE__ inference and the :erlang.raise/3 signature, allowing arbitrary keyword metadata.

Assisted-by: Codex:GPT-5.6
2026-08-27 09:37:44 +02:00
José Valim 21a1e47740 Fix warnings when running tests 2026-08-24 17:00:16 +02:00
Alexander Gubarev 093d4c8873 Fix final sigma handling in :greek (#15791) 2026-08-24 16:05:49 +02:00
José Valim 63a7a054ce Remove none clauses if there are non empty clauses, closes #15777 2026-08-22 12:00:55 +02:00
Dino Kovač 4f0c820624 Add DateTime add/4 and shift_zone/3 UTC fast path (#15779) 2026-08-22 10:02:25 +02:00
Daniel Kukula 5d605debe1 Fix base64 swar singleton false positive (#15773) 2026-08-21 09:13:59 +02:00
Hasan mohamed 345507aca9 Fix type checker crash on non-returning for ... into: expression (#15747) (#15770) 2026-08-20 22:39:18 +02:00
Thomas Cioppettini c4b42ddbbe Add unit fast paths to Calendar.ISO.iso_days_to_unit/2 (#15771)
Assisted-by: Claude Code:claude-fable-5

Signed-off-by: Thomas Cioppettini <544875+tomciopp@users.noreply.github.com>
2026-08-20 22:35:19 +02:00
Daniel Kukula 6cde8680ab Remove intermediate list in elixir_interpolation hex_to_int (#15767) 2026-08-18 17:36:38 +02:00
Thomas Cioppettini 02124013de Replace protocol dispatch with arithmetic in Access.slice/1 (#15764)
Assisted-by: Claude Code:claude-fable-5

Signed-off-by: Thomas Cioppettini <544875+tomciopp@users.noreply.github.com>
2026-08-16 21:24:13 +02:00
Thomas Cioppettini 82196d2bd9 fix: Range.disjoint?/2 for ranges beyond float precision (#15760) 2026-08-16 08:42:59 +02:00
Eric Meadows-Jönsson a357d19110 Optimize comparison of parsed versions (#15748) 2026-08-14 07:06:30 -07:00
Alexander Gubarev bc7844c26c Fix Date.to_iso8601/2 loses :format with custom calendar (#15740) 2026-08-13 21:39:28 +02:00
Alexander Gubarev c929e885bb Fix struct key malformed error message (#15735) 2026-08-12 23:46:03 +02:00
Alexander Gubarev 7bf65189db Fix Task.yield_many/2 waits too long or forever when :limit exceeds task count (#15737) 2026-08-12 20:51:46 +02:00
Nelson Vides f316902a80 Optimize URI.encode_www_form/1 and RFC 3986 query encoding (#15736)
Both encoders were built on a binary comprehension whose body calls
`percent/2` through a captured predicate:

    for <<byte <- string>>, into: "" do
      case percent(byte, &char_unreserved?/1) do
        "%20" -> "+"
        percent -> percent
      end
    end

`for ... into: ""` over a binary generator compiles to a native Erlang
bitstring comprehension, so the comprehension itself is fine, but in the
body it pays per byte a `make_fun3` to build the captured predicate, a
call to `percent/2` plus an indirect call through it, a freshly
allocated one- or three-byte binary that is discarded immediately, an
`is_eq_exact` against the literal "%20", and a runtime-sized
`bs_create_bin` to append the result.

Rewrite it as a tail-recursive loop that writes the escape straight into
the accumulator. The unreserved test moves into a `defguardp` so it
inlines instead of going through a closure, `+` is handled by its own
clause rather than by comparing the produced binary against "%20", and
the appended segments have compile-time-known sizes.
2026-08-12 18:31:55 +02:00
José Valim b911bb0380 Raise when | is used in guards, closes #15734 2026-08-12 07:42:25 +02:00
José Valim 6ef6f78206 Properly escape unicode codepoints above ASCII range 2026-08-11 17:10:23 +02:00
Mikhail Nekrashevich 44085d4347 Escape C1 control characters with Unicode escapes (#15726)
Assisted-by: Codex:GPT-5
2026-08-09 09:21:22 +02:00
makoto-developer 0bd52d4a7e Only use do-end blocks when every trailing keyword is a block keyword (#15725) 2026-08-08 09:05:26 +02:00
Alexander Gubarev 8b584147e8 Validate microseconds in Time.from_seconds_after_midnight/3 (#15721) 2026-08-07 18:09:37 +02:00
Jonatan Männchen 5e7cb9a707 Add Path.safe_join/2 (#15720) 2026-08-07 15:57:22 +02:00
José Valim 2971952edc Fix escaping of literal interpolated strings, closes #15718 2026-08-07 12:28:51 +02:00
Daniel Kukula e697189e3b Remove intermediate list in float parse (#15719) 2026-08-07 10:33:00 +02:00
Barna Kovacs 8c49052a41 Optimize Calendar.ISO.parse_duration/1 (#15709)
Apply the leading duration sign as components are parsed, avoiding a second pass for negative durations.

Track allowed date and time units with ordered positions instead of keyword-list tails and recursive lookups.

Assisted-by: Codex:GPT-5
2026-08-01 21:43:46 +02:00
Alexander Gubarev a0b17a355a Fix Code.Typespec.spec_to_quoted/2 incomplete variable type collection (#15700) 2026-07-29 19:17:07 +02:00
Alexander Gubarev 2d0e5bab83 Fix Date.range/3 raises wrong exception for invalid step (#15690) 2026-07-28 13:51:46 +02:00
Guillaume Duboc 745ee1d538 Fix none handling + map fetch rewrite (#15686) 2026-07-27 13:59:08 +02:00
Łukasz Samson 9e78534880 Do not return {:ok, _} on maps with empty lines in map_put_static_value (#15597) 2026-07-25 18:29:08 +02:00
Łukasz Samson 17f782e0eb Fix tuple_insert_static crash on non-normalized empty type (#15542)
Closes #15541.
2026-07-25 09:38:44 +02:00
Guillaume Duboc e303c78201 Rework tuple projection algorithm (#15668) 2026-07-25 09:14:30 +02:00
Barna Kovacs 70624eff47 Remove redundant abs calls from Range (#15666) 2026-07-24 17:10:30 +02:00
Alexander Gubarev ffcea82a1e Fix Calendar.strftime/3 width calculations (#15665) 2026-07-24 09:29:25 +02:00