Commit Graph
12807 Commits
Author SHA1 Message Date
Alexander Gubarev 36351ae051 Fix float round/2, floor/2, ceil/2 raises wrong exception for invalid precision (#15872) 2026-09-08 18:06:30 +02:00
Barna Kovacs 5034b7fa6b Defer function domain disjointness until nonemptiness succeeds (#15870)
Skip pairwise disjointness checks when nonemptiness fails.

Assisted-by: Codex:GPT-6
2026-09-08 14:54:59 +02:00
Alexander Gubarev 7f3b294e19 Fix kernel defstruct doc example (#15867) 2026-09-08 08:53:16 +09:00
José Valim 7427c0cf5d A binary may always be returned in a comprehension, closes #15857 2026-09-07 16:24:15 +02:00
Barna Kovacs 24d5016632 Reuse existing tuple leaves when fusion fails (#15860) 2026-09-06 01:29:20 +02:00
Barna Kovacs 1d0094e3f8 Avoid duplicate arithmetic in Calendar.ISO.from_unix/2 (#15861)
Compute seconds and microseconds together with div_rem/2,
preserving floor division for negative timestamps.

Assisted-by: Codex:GPT-6
2026-09-06 00:43:04 +02:00
Barna Kovacs bb69e59b5c Correct tuple difference comments (#15859)
Size and content branches may overlap. The disjointness fast path leaves
the positive tuple unchanged.

Assisted-by: Codex:GPT-6
2026-09-05 21:03:41 +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
Łukasz Samson 695401e58b Fix __CALLER__.macro_aliases type (#15853)
Assisted-by: Codex:GPT-5
2026-09-05 11:50:37 +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
Alexander Gubarev 6d4d45a268 Tighten macro unpipe/1 spec (#15850) 2026-09-05 09:44:30 +02: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
andresg-tsiglobal 6f635d4f12 Add missing 'end' to example in docs (#15846) 2026-09-04 20:28:21 +02:00
Barna Kovacs 3b5bcaa6d8 Clarify Keyword.drop/2 duplicate key behavior (#15844) 2026-09-04 13:19:14 +02:00
Alexander Gubarev b0d02d3965 Fix macro dbg/3 ignores ANSI color setting (#15842) 2026-09-04 08:34:50 +02:00
Barna Kovacs 96d47e12b2 Avoid list allocation in OptionParser when checking underscores (#15843)
Assisted-by: Antigravity:Gemini-3.8-Flash
2026-09-04 08:32:25 +02:00
Alexander Gubarev 394113faac Fix macro unescape_string/2 spec and doc (#15841) 2026-09-03 17:21:24 +02:00
Barna Kovacs bef6436cda Inline Calendar.ISO parsing heads and eliminate guarded helpers (#15840)
Pattern matching on "-" and "+" binary prefixes directly across the
public function heads of parse_date/2, parse_naive_datetime/2, and
parse_utc_datetime/2 eliminates the need for parse_date_guarded/2,
parse_naive_datetime_guarded/2, and parse_utc_datetime_guarded/2.

This removes an intermediate function dispatch on every date and
datetime parsing call and removes 9 lines of code.

Assisted-by: Antigravity:Gemini-3.7-Flash
2026-09-03 14:28:30 +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
Barna Kovacs 6fde3de13f Deduplicate gradual descriptor alignment (#15832) 2026-09-02 21:34:09 +02:00
Barna Kovacs a229c0e301 Optimize JSON map key encoding (#15824)
Inline the per-key dispatch to avoid a private function call for every encoded map entry.

Assisted-by: Codex:GPT-5
2026-09-01 09:34:37 +02:00
José Valim 87af1e34ec Do not check for emptiness in tuple element fallback 2026-09-01 01:05:04 +02:00
José Valim 3a21a6a50a Do not accept empty tuples in several tuple functions, closes #15817 2026-09-01 01:01:24 +02:00
Barna Kovacs 1962a66575 Avoid rebuilding Cartesian map suffixes (#15823) 2026-09-01 00:59:53 +02:00
Alexander Gubarev c6d5bbcd9d Remove duplicate :elixir_def from Kernel.CLI @elixir_internals (#15819) 2026-08-31 18:02:28 +02:00
Alexander Gubarev 4fbdbc8acd Fix functions with impossible clauses typecheck crash (#15794) 2026-08-31 17:56:45 +02:00
Tyler A. Young 05576dd133 perf: Speed up Enum.dedup_by/2 on lists via a hand-rolled, tail-recursive implementation (#15815)
This improves the runtime of `Enum.dedup_by/2` on lists by replacting the generic `reduce/3` implementation with a hand-rolled version similar in spirit to the `dedup_list/1` optimization. In my benchmarking, the magnitude of the improvement depends heavily on the size and shape of the data, but it looks roughly like this:

| List length | Duplicates | Speedup |
|          10 |          0 |   +140% |
|       1,000 |          0 |    +81% |
|   1,000,000 |          0 |     +7% |
|          10 |        20% |   +116% |
|       1,000 |        20% |    +64% |
|   1,000,000 |        20% |     +2% |
|          10 |        50% |    +45% |
|       1,000 |        50% |    +62% |
|   1,000,000 |        50% |    +12% |
2026-08-31 17:50:38 +02:00
Alexander Gubarev 9e2f0ff348 Improve message for typespecs stepped ranges (#15816) 2026-08-31 17:32:19 +02:00
Alexander Gubarev c86e8d2b54 Fix Kernel.SpecialForms ::/2 doc example (#15818) 2026-08-31 17:31:39 +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
Rodolfo Carvalho 0ae594d716 Update Windows argument splitting warnings in Port and System (#15813)
Align the Windows argument splitting warning with Erlang/OTP's
open_port/2 documentation by including .cmd in the list of affected
extensions alongside .bat and .com, and fixing a missing final period.

Also polish the mitigation advice grammar to maintain parallelism
(double-checking).

Assisted-by: Antigravity:Gemini-3.7-Flash
2026-08-31 11:12:51 +02:00
Jaideep Pyne a164205866 Add U+055F to the case ignorable set (#15812)
U+055F ARMENIAN ABBREVIATION MARK has Word_Break=MidLetter and is
Case_Ignorable in the UCD, but it was missing from the hardcoded list,
so the Greek final sigma context scan stopped at it instead of skipping
it. This affects String.downcase/2 and String.capitalize/2 in :greek
mode on both sides of the Final_Sigma rule.

Assisted-by: Claude Code:claude-opus-5
Signed-off-by: jaideeppyne <jaideeppyne1997@gmail.com>
2026-08-30 19:02:30 +02:00
Alexander Gubarev 0c8f1feb3a Remove unused task pid from from async stream internal state (#15806) 2026-08-28 19:54:01 +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
Barna Kovacs 78f22cc8ef Refactor Enum.slide/3 list assembly (#15803)
Avoid concatenating at the end of lists.
2026-08-28 11:19:18 +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
Barna Kovacs 7d2a3d8a69 Reuse upper bound extraction in type descriptors (#15792)
Inline upper_bound/1 and replace Map.get(descr, :dynamic, descr) calls
with inlined pattern matching to eliminate function call overhead.

Assisted-by: Antigravity:Gemini-3.7-Flash
2026-08-24 17:59:24 +02:00
José Valim 21a1e47740 Fix warnings when running tests 2026-08-24 17:00:16 +02:00
Barna Kovacs 4bc288d47d Unify map domain type lookup (#15789)
Inline map_domain_tag_to_type/2 and remove the dead map_domain_tag_to_type/1 forwarding helper.

Assisted-by: Antigravity:Gemini-3.7-Flash
2026-08-24 16:27:11 +02:00
Barna Kovacs 2b2a99d0cf Avoid wrapping function arguments in phi_starter (#15788)
The return type was unused by disjoint_non_empty_domains?/3. Pass arguments directly to avoid tuple allocation.

Assisted-by: Antigravity:Gemini-3.7-Flash
2026-08-24 16:08:25 +02:00
Łukasz Samson e3d2cea83a Fix inferred type of :erlang.split_binary/2 result when arg is bitstring (#15790) 2026-08-24 16:06:02 +02:00
Alexander Gubarev 093d4c8873 Fix final sigma handling in :greek (#15791) 2026-08-24 16:05:49 +02:00
Barna Kovacs 628afe5b74 Avoid rebuilding list on failed element pop (#15787)
Return the updated list or :error directly.

Assisted-by: Antigravity:Gemini-3.7-Flash
2026-08-24 15:23:48 +02:00
Barna Kovacs 3d8b254724 Avoid rebuilding map domains during lookup (#15786)
map_get_domain/3 only consumes the selected domain value, but map_pop_domain_bdd/3 also rebuilt and returned the remaining map BDD. Use the existing domain lookup helper directly so negated map lookups do not construct state that is immediately discarded.

Assisted-by: Codex:GPT-5
2026-08-23 19:22:35 +02:00