Repository navigation
D216: a contract states a polled tagged message; the program iterates it as an open sum (closes #2425) - #3631
Merged
Merged
Conversation
added 13 commits
November 26, 2026 05:17
…fuses it by name until it is verified and presented
…mport; refused by name until it is presented
…meral open sum and a poll generator
… parameters, and release after each body
… wildcard arm), and an Other arm that compares with a named constant is warned
…nty-two refusals
…w counted ceremony
…ource refuses a nested poll with a panic
…ed contract text reaches the standard library without giving the program a name
…producer receives mut; a static method's mut first parameter is not a receiver. The borrow is not yet held across the loop (#3624): err_d216_poll_holds_its_resource does not pass
…the renderer writes
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.
Closes #2425. D216 (Eric, 2026-11-18); the words (§16.2b.9a, spec v7.93) blessed by him on 2026-11-25 with five edits, the guard for the no-resource case and its sentence approved the same day.
The item.
message Name wraps Recordwithfrom f(out param N),tag F,case K when CONST [..CONST] [field f | : T], and for the pointer formpayload P size Nandrelease f. Verified against the import; 22 wrong contracts each get one error naming the line.What it presents. An ephemeral open sum
Namewith the stated cases andOther(tag), andName.poll(…), iterated withfor. Amatchon it keeps a_arm. A typed pointer case is entered only when the pointer is non-null, large enough and aligned.releaseruns after each body, an earlybreakincluded.Safety of
releasemessages.polltakes itmut, so nothing else touches it while the loop runs (this rests on A gen fn's mut parameter is the caller's place, held by the generator alone while its loop runs (closes #3624) #3627 and A generator's mut hold lends its yielded views, and the held place is not read by name in the loop #3630).Three compiler changes this needed.
mutwas taken for a mutating method (method_has_mut_self_flagdid not ask whether parameter 0 is the receiver). Fixed, withbehav_static_method_with_mut_first_param.Atomic), and nothing else; the program gains no name (err_d216_rendering_imports_nothing_for_the_program).Tests.
behav_d216_message_{union,pointer,nested_poll_panics,poll_from_two_threads_panics,poll_borrows_its_resource}, 24err_d216_*.Stated gaps (in the subsection itself). The poll is presented without thread affinity. Steam itself was not tried: its SDK is not a
with getpackage; the pointer form is tested against a header of the same shape, and the union form against SDL 3.4.16.Evidence. Battery GREEN on f749736;
:release-checks, the full census and:spec-inventory-checkgreen on the same commit.