Repository navigation
A field with a default may omit its type; a numeric default takes the type its uses demand (D89, #2097) - #2105
Merged
Merged
Conversation
added 2 commits
October 4, 2026 16:35
Spec v7.20 §4.3: `type T { ticks = 0, alive = true, pos = Vector2 { … } }`.
The field has the type its default makes evident: a literal's, a struct
literal's. A default that does not (a call) is an error asking for the
type. An unsuffixed numeric default is i32 or f64 for now; taking the type
the field's uses demand is the next change.
…and (D89, #2097) Spec v7.20 §4.3. A program with such a field is checked twice: once to hear what the field's uses demand (each field is a distinct alias of its default type, so an owned demand or a peer operand names its field; nothing is reported), then with every field at the type decided. No demand leaves `i32` or `f64`; two different demands are an error at the field that asks for its type. A program without such a field is checked once, as before.
Contributor
Author
|
Battery GREEN for stack #2106 at d5c7b59 (macOS arm64, seed-driven, |
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.
Implements spec v7.20 §4.3 (D89). Fixes #2097.
name = default; the type is what the default makes evident (a literal's, a struct literal's). A default that does not say (a call such asVec.new()) is an error asking for the type — narrower than the spec's "the type of its default" for calls; noted as remaining.i32/f64; two → error at the field. Done by checking such a program twice.Stage1 only so far — no gate, no battery.