Skip to content

D103, D104: value-to-Option conversion; inferred comptime-callability (spec words) - #2221

Merged
ehartford merged 1 commit into
mainfrom
docs-d103-d104
Oct 6, 2026
Merged

ehartford merged 1 commit into
mainfrom
docs-d103-d104

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Docs only: the blessed words for #2217 (§4.9a, D103) and #2213 (§17.1, D104), decision log entries, follow-up #2220. No compiler change; the compiler is non-compliant with both until the implementation PRs land. Gate: spec-inventory-check.

…inferred, comptime fn a checked promise (§17.1)

Ruled by Eric 2026-10-07 (#2217, #2213). §4.9a: where Option[T] is
demanded and the expression has type T it is Some(expression); None and an
existing Option pass unchanged; once, at the demand, never where nothing is
demanded, never in inference; demand propagates into arms and tails;
operator operands are not demand sites. §17.1: a function is
comptime-callable when nothing it calls transitively does what the section
forbids; comptime fn is checked statically at the declaration (indirect
calls refused), a plain function by the evaluator when a compile-time call
reaches it; a forbidden operation reports the chain of calls; Zig's hole is
stated plainly as the accepted trade. Follow-up #2220 (comptime allocator).
The compiler is non-compliant with both until implemented.
@ehartford
ehartford marked this pull request as ready for review October 6, 2026 19:44
@ehartford
ehartford merged commit 99aec86 into main Oct 6, 2026
@ehartford
ehartford deleted the docs-d103-d104 branch October 6, 2026 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant