Repository navigation
fix: refuse a closed set's base-class member the generators introduce, and keep its sealed ToString() - #218
Merged
CaffeinatedCoder merged 1 commit intoOct 31, 2026
Conversation
…, and keep its sealed ToString() ClosedSetTypes read the set's own members alone. A base class's Parse(string), Parse(string, bool), TryParse(string?, bool, out TSelf), Match, a static All, a protected _name, an IParsable<TSelf> it implements, and its sealed ToString() failed the aspect (LAMA0500, LAMA0502, LAMA0503, LAMA0512), naming nothing the user wrote, in this project and from another. A base class's ToString() that is not sealed was replaced by the generated one without a word, where a value object's base record's has been CMTK1011 since phase 11. The checks of names and signatures now read each base class, private members aside (a base's private _name and _all built and still do), and an IParsable<TSelf> a base implements is named with its base. A base's sealed ToString() is the seam, through ValueObjectDeclaration's own check; one not sealed is CMTK1011 with the value objects' remedy. Decision 121 records refusing it over taking it as the seam, which would change what such a set prints in a patch, and the exception to decision 34: such a set built on 2.3.0. CS0738 joins CS0535 as what a refused set may leave, where a base's All has another type. Input class (GTS): a generated closed-set member, by where it is declared. Catalogue in BuildOutcomeTests: each member above in a base class of this project, Parse, IParsable and both ToString() forms in a library base, QualifiedName (refused before, through the interface mapping), and four that build: a sealed ToString() of either assembly, private fields, a [JsonConverter] on the base. InheritedMembersTests holds what a set over a sealed ToString() prints. Siblings found by the catalogue: All, Match, Parse(string, bool), TryParse(string?, bool, out) and a protected _name, beyond the three the report named. Removing the base reads and the ToString() refusal fails the 11 new refusal rows and the two LAMA guards (13 of 310 BuildOutcomeTests); reverting the seam fails the test project's build on MaskedSet. Refs #205 Defect-Class: GTS Found-By: CA Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 30, 2026
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 #205
Problem
ClosedSetTypesread the set's own members alone. A base class'sParse(string),Parse(string, bool),TryParse(string?, bool, out TSelf),Match, a staticAll, a protected_name, anIParsable<TSelf>it implements, and itssealedToString()failed the aspect (LAMA0500, LAMA0502, LAMA0503, LAMA0512) naming nothing the user wrote, in this project and from another. A base class'sToString()that is not sealed was replaced by the generated one without a word, where a value object's base record's is CMTK1011.Change
_nameand_allbuilt and still do); anIParsable<TSelf>a base implements is named with its base. CMTK1011 says "in its base type X".sealedToString()is the seam, throughValueObjectDeclaration.DeclaresToString; one not sealed is CMTK1011 with the value objects' remedy (declareToString()in the set, or seal the base's).ToString()is not sealed. Decision 121 records refusing over taking it as the seam (which would change what such a set prints in a patch, without a word) and the exception to decision 34; the changelog says what to write instead.BuildOutcomeTests, where a base'sAllhas another type.design/aspects.md,design/closed-sets.md, the ADR index, two claims.Tests
BuildOutcomeTests: each member above in a base class of this project,Parse,IParsableand bothToString()forms in the fixture's library base,QualifiedName(refused before, through the interface mapping), and four that build: a sealedToString()of either assembly, private fields, a[JsonConverter]on the base.InheritedMembersTestsholds what a set over a sealedToString()prints, with its name,All,Parseand JSON generated as usual;GeneratedSurface.verified.txtgains that set.ToString()refusal fails the 11 new refusal rows and the two LAMA guards (13 of 310); reverting the seam fails the test project's build onMaskedSet.Found by a sweep of
release/2.3.1@dbdd44efor the defect class of #191-#197.🤖 Generated with Claude Code