Repository navigation
fix: refuse a seam a base record declares in place of the value object - #203
Merged
CaffeinatedCoder merged 2 commits intoOct 30, 2026
Merged
Conversation
A base record's CompareTo(TSelf) was not seen as the comparison seam: DeclaresCompareTo read the value object's own methods, so no [HandWrittenOrdering] was put on it and an EF Core query ordered by the column ([1, 2]) where memory ordered [2, 1]. The generated CompareTo(TSelf) was not introduced, since OverrideStrategy.Ignore saw the inherited one, and the generated operators and CompareTo(object) called left.CompareTo(right), which C# binds to the generated CompareTo(object), declared on the more derived type: < overflowed the stack and ended the process. A base's TryFrom(T) and Revalidate() were the value object's in the same way, and the generated ones, which run Create, were not introduced. A base's CompareTo(object) failed the aspect (LAMA0500). HandWrittenComparisonMembers reports a base record's CompareTo(TSelf) and CompareTo(object) (CMTK1008), named once where the interface mapping finds the second too. ValueObjectDeclaration.InheritedSeams reports a base's TryFrom(T) and Revalidate() on a validated value object (CMTK1011), whose remedy says to declare it on the value object. A base's FromKnownGood(T) is another signature than the generated one, which takes the caller's expression too and hides it, so it stays allowed. Decision 121 records the choice over taking a base's as the seam. Input class (GTS): a seam, by where it is declared. Catalogue: each seam in a base record (CompareTo(TSelf), CompareTo(object), TryFrom, Revalidate, FromKnownGood), beside the value object's own seams the suite already holds. A base's sealed ToString() stays the seam. Reverting the source to 03e199b fails 6 of 285 BuildOutcomeTests; each guard's own seed fails only its rows, the named-once check included. Refs #194 Defect-Class: GTS Found-By: OR Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Base automatically changed from
fix/interface-explicit-implementation-refused-2-3-1
to
release/2.3.1
October 30, 2026 17:31
This was referenced Oct 31, 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 #194
Problem
A base record that declares a seam stood in for the generated member without a word:
ValueObjectComparableAspect.DeclaresCompareToread the value object's own methods, so the inherited seam got no[HandWrittenOrdering], and EF Core ordered by the column.CompareTo(TSelf)was not introduced, becauseOverrideStrategy.Ignoresaw the inherited one.CompareTo(object)callleft.CompareTo(right). C# binds that to the generatedCompareTo(object), declared on the more derived type, so it called itself.TryFrom(T)andRevalidate()were the value object's the same way, and the generated ones, which runCreate, were not introduced.CompareTo(object)failed the aspect (LAMA0500).Measured on
release/2.4.0and again on #201's branch, the code unchanged since 2.3.0.Change
HandWrittenComparisonMembersreports a base record'sCompareTo(TSelf)andCompareTo(object)as CMTK1008. A member that the interface mapping also finds is named once.ValueObjectDeclaration.InheritedSeamsreports a base'sTryFrom(T)andRevalidate()on a validated value object as CMTK1011. The remedy says to declare it on the value object, calling the base's if that is what's meant.FromKnownGood(T)stays allowed. Its signature differs from the generated one, which takes the caller's expression too and hides it.sealedToString()stays the seam.design/aspects.md, the 2.3.1 changelog and claimC22-a-seam-in-a-base-recordfollow.Tests
BuildOutcomeTests(285):What_a_base_record_declares_is_refused_by_namegains the four seams in a base record.A_seam_or_a_foreign_bound_is_not_refusedgains a base'sFromKnownGood, which builds.A_base_member_found_twice_is_named_onceholds theDistinct.Reverted (
verify-the-guard):03e199b)Every_error_is_one_of_the_intended_onesandNested_value_objects_...(LAMA0500)HandWrittenComparisonMembersCompareTorows, plus the LAMA guardsInheritedSeamsreturns noneTryFromandRevalidaterowsFromKnownGoodas a seamFromKnownGoodcontrol, plus the compile-error guardsDistinctA_base_member_found_twice_is_named_onceVariants. Input class GTS: a seam by where it's declared: each seam in a base record, beside the value object's own seams the suite already holds.
Built on #201 (merged into
release/2.3.1as 8fac39b), whose helpers and build-outcome library fixture it uses.🤖 Generated with Claude Code