Repository navigation
D103, D104: value-to-Option conversion; inferred comptime-callability (spec words) - #2221
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.