Issue #2548: A result type computed from comptime parameters, and –comptime showing what was specialised

Open and answer this issue on GitHub.

ready · opened 2026-11-21 · updated 2026-11-21 · 0 comments

Part of #906 After #2547

What it is

ADR-specialization-1 D7: a result type may be computed while building from comptime parameters (pub fn compile(comptime pattern: String) -> Regex[engine_for(pattern)]), only from comptime, not comptime?, parameters; a type written where the result is received is checked against it. D8: --comptime shows what was specialised: per comptime? function its copies and their values, per call the copy it calls or ordinary and why, per @unroll the turns or not unrolled and why, the branches D4 decided and the types D7 computed. Was #906 items 6 and 7; #673 step 7 builds on this.

To build

  1. D7: a result type computed by a call the build may run over the function’s comptime parameters. Test: a function whose result type is computed from a comptime parameter, and a receiving type that does not match it refused (tests/compiler/tests/).
  2. D8: the report in --comptime. Test: an --comptime run over a program with a comptime? function called both ways, an @unroll loop over and under up_to, a decided match and a computed result type, the report in the .stdout.

Done when

A result type computed from a comptime parameter is checked like a written one, and --comptime lists copies, calls, unrolled loops, decided branches and computed types, each shown by its test; the last commit carries Fixes #N for this issue, and the report gives a Found: line per finding.

Split from #906 by Claude Code

Back to Open Issues