Commit Graph
12807 Commits
Author SHA1 Message Date
Daniel Kukula 25bba6c57e Use tail recursion in tuple aggregates (#15708) 2026-08-01 21:54:16 +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
Barna Kovacs dc1ac5f461 Remove redundant pending clause check (#15707) 2026-07-31 16:54:07 +02:00
Barna Kovacs 03dda70bdd Optimize key lookups in Macro (#15706)
Use fetch operations to avoid looking up keyword and map keys twice.

Assisted-by: Codex:GPT-5
2026-07-31 15:40:42 +02:00
Barna Kovacs 1a711f95d3 Fix typespecs for scoped macro counters (#15705) 2026-07-30 21:38:01 +02:00
Alexander Gubarev df537c4d44 Fix Calendar.strftime/3 perfomance regression (#15704) 2026-07-30 17:04:53 +02:00
Alexander Gubarev a46b6e3ade Fix Code.Fragment specs and docs (#15701) 2026-07-30 12:34:48 +02:00
Alexander Gubarev ca29070564 Fix Code doc wordings and clarify (#15703) 2026-07-30 12:29:50 +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 a5e437e2cd Fix Code specs and docs (#15699) 2026-07-29 15:26:48 +02:00
Alexander Gubarev 2d0e5bab83 Fix Date.range/3 raises wrong exception for invalid step (#15690) 2026-07-28 13:51:46 +02:00
José Valim 8425a039f2 Avoid double comparisons in predicate functions 2026-07-28 13:39:44 +02:00
Alexander Gubarev 550b01db0d Fix Code.Formatter typos (#15691) 2026-07-28 10:41:47 +02:00
José Valim 8a1bbb59df Warn on errors from orphan compiler modules 2026-07-28 10:19:21 +02:00
Guillaume Duboc 745ee1d538 Fix none handling + map fetch rewrite (#15686) 2026-07-27 13:59:08 +02:00
José Valim ce47442332 Remove Erlang Syntax crash course link
Closes #15680.
2026-07-27 10:08:55 +02:00
Alexander Gubarev 6c413a893b Fix Calendar docs wordings and clarify (#15684) 2026-07-27 09:47:52 +02:00
Alexander Gubarev 6ef392a98d Add specs to Kernel.ParallelCompiler.pmap (#15683) 2026-07-27 09:47:19 +02:00
Alexander Gubarev 2dcba2c0cb Add specs to Config.config and Config.read_config (#15682) 2026-07-27 09:47:00 +02:00
Alexander Gubarev 9f490a187f Add specs to Macro.compile_apply (#15681) 2026-07-27 09:45:32 +02:00
Benjamin Milde 7c836e221a Remove trailing comma from doctest (#15679) 2026-07-26 18:44:37 +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
Barna Kovacs b8c1eb7de2 Defer function application computations until needed (#15676) 2026-07-25 18:28:58 +02:00
Barna Kovacs 4e616904c1 Remove redundant abs calls from Calendar.ISO (#15675)
The BCE guards establish the sign of both calculations, so compute their positive magnitudes directly.

Assisted-by: Codex:GPT-5
2026-07-25 17:33:20 +02:00
Jean Klingler a8d9921a89 Add admonition block about MapSet opaqueness issue (#15674) 2026-07-25 17:01:20 +09:00
Barna Kovacs 82e17e8bc3 Remove redundant abs call from Date.Range (#15669)
The preceding clauses handle steps that point away from the last date.
Otherwise, `last_days - first_days` and `step` have the same sign,
so `div/2` is already non-negative.
2026-07-25 09:40:15 +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
Barna Kovacs 6fda428a21 Remove redundant min from Enum.drop/2 (#15671)
The negative amount guard guarantees amount + count is always less than count.

Assisted-by: Codex:GPT-5
2026-07-25 09:23:06 +02:00
Guillaume Duboc e303c78201 Rework tuple projection algorithm (#15668) 2026-07-25 09:14:30 +02:00
Renan Ribeiro 0f832059da Fix typo in keyword module documentation (#15670) 2026-07-25 09:12:54 +02:00
Alexander Gubarev 3b96b74a51 Add specs to Kernel.binary_slice (#15667) 2026-07-24 17:51:49 +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
Alexander Gubarev a8f18d8105 Fix Kernel.ParallelCompiler.compile_opts() type each_cycle spec (#15664) 2026-07-24 08:37:10 +02:00
Alexander Gubarev aaaa921781 Fix pages code examples (#15663) 2026-07-24 08:32:58 +02:00
Alexander Gubarev e308336c94 Fix Calendar.strftime negative year as 2-digits formatting (#15658) 2026-07-23 18:36:19 +02:00
Alexander Gubarev 6e57f00e4b Fix Calendar.ISO.valid_time? ms_precision guard (#15655) 2026-07-23 08:37:45 +02:00
Alexander Gubarev e713dc9c9b Fix kernel docs wordings and clarify (#15654) 2026-07-22 19:39:25 +02:00
Alexander Gubarev 8eb51e6494 Fix Calendar.ISO self-referencing doc in naive_datetime_to_iodata, datetime_to_iodata (#15653) 2026-07-22 17:40:07 +02:00
Alexander Gubarev e641683a41 Fix Calendar.ISO.parse_time negative zero offsets in basic format (#15651) 2026-07-22 15:53:38 +02:00
Alexander Gubarev 4270828c93 Fix ParallelCompiler doc wordings and typos (#15652) 2026-07-22 15:43:10 +02:00
nseaprotector 002e42d574 Fix diff/3 rounding for :day, :hour and :minute (#15650)
The `:day`, `:hour` and `:minute` clauses of `Time.diff/3`,
`DateTime.diff/3` and `NaiveDateTime.diff/3` compute the difference in
seconds first and then divide again, so the sub-second remainder is
rounded twice. The intermediate conversion floors while the final
`div/2` truncates, so the result follows neither rule:

    # elapsed is 23:59:59.999998, less than a full day
    Time.diff(~T[00:00:00.000001], ~T[23:59:59.999999], :hour)
    #=> -24, while the opposite direction returns 23

    # elapsed is 86399.5s, and the docs promise incomplete days round to zero
    NaiveDateTime.diff(~N[2000-01-01 00:00:00.7], ~N[2000-01-02 00:00:00.2], :day)
    #=> -1

Compute the difference in microseconds and divide once instead. This
keeps the documented truncation ("fractional results are not supported
and are truncated", "it also rounds incomplete days to zero") in both
directions. Positive results are unchanged, so the existing
`DateTime.diff/3` "almost 7 days" test now gains its negative
counterpart.

Assisted-by: Claude Code:claude-opus-4-8
2026-07-22 13:09:34 +02:00
Alexander Gubarev e94774926b Fix elixirc --profile time switch argv parsing (#15647) 2026-07-21 21:18:49 +02:00
Alexander Gubarev 7918013cfd Fix String.reverse/1 grapheme ordering around invalid utf8 bytes (#15645) 2026-07-21 20:48:24 +02:00
Łukasz Samson fa7db38e6f Improve send return type (#15644)
Teach the type checker that Kernel.send/2 returns the message operand.
2026-07-21 20:32:02 +02:00
José Valim 1a63a83e07 Improve String synchronization docs 2026-07-21 19:35:40 +02:00
Frank Hunleth cff8010e80 Fix System.cmd/3 unit test that fails on Ubuntu 26.04 (#15646)
This test runs `System.cmd/3` against a symlink to the `echo` command.
This works when `echo` is its own binary and when it's in a multicall
binary that's dispatched using `argv[0]`. It doesn't work for the new
Rust/uutils coreutils which doesn't dispatch via `argv[0]`. In this
case, intended call to echo produces no output:

```
  1) test Unix cmd/3 with absolute and relative paths (SystemTest)
     test/elixir/system_test.exs:210
     match (=) failed
     code:  assert {"hello\n", 0} = System.cmd(Path.join(File.cwd!(), @echo), ["hello"], arg0: "echo")
     left:  {"hello\n", 0}
     right: {"", 0}
     stacktrace:
       test/elixir/system_test.exs:223: anonymous fn/0 in SystemTest."test Unix cmd/3 with absolute and relative paths"/1
       (elixir 1.21.0-dev) lib/file.ex:2100: File.cd!/2
       test/elixir/system_test.exs:215: (test)
```

This fix switches the binary used for the test over to `sh` which fixes
the issue on Ubuntu 26.04. This was also verified on Ubuntu 24.04,
Ubuntu 22.04, Alpine Linux 3.24, macOS Tahoe (26.5.1) and MacOS Sequoia
(15.3.2).
2026-07-21 18:42:15 +02:00
Alexander Gubarev dbf74a6098 Fix Registry doc and specs (#15640) 2026-07-20 23:37:05 +02:00
Barna Kovacs 450a24c840 Optimize Range.disjoint?/2 empty checks (#15639) 2026-07-20 18:14:03 +02:00
Alexander Gubarev ba04ada65d Fix StringIO.open/2 doc (#15638) 2026-07-19 20:08:07 +02:00