Repository navigation
fix: options assign ignores computed properties - #68
Merged
kieronlanning merged 2 commits intoNov 20, 2026
Merged
Conversation
kieronlanning
deleted the
fix/options-assign-skips-computed-properties
branch
November 20, 2026 10:58
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.
Problem
OptionsHelper.Assign<TOptions>(o => ...)infers the path an assignment set by seeding two copies of the options with different sentinels, running the assignment on both, and collecting the leaves that ended up equal. A get-only leaf cannot be seeded, so it is always equal and was always counted.Since 2.2, a kit with
[EndpointUrl]or[ResourceUrl]carries aResourceKitUrloption, whoseIsAbsoluteis computed. EveryAssignon that host kit's options then threw, for example:Found in a consumer AppHost after adding
[EndpointUrl](2.2.1): its test fixtures and composition tests build arguments withOptionsHelper.Assign.Fix
CollectEqualLeafPathsskips get-only leaves (scalar,stringorobjectwith no setter). They can be neither assigned nor bound from configuration, so they are never the path an assignment set.Tests
Assign_GivenOptionsWithAComputedProperty_IgnoresItfailed before ("Found 2 candidate paths: UseDbGate, Https:IsAbsolute") and passes after.ResourceKit.UnitTests: 300/300 on net10.0 and net11.0; CSharpier check clean.