Define Each behavior when Constants.Null is passed as restriction#475
Open
konard wants to merge 4 commits into
Open
Define Each behavior when Constants.Null is passed as restriction#475konard wants to merge 4 commits into
konard wants to merge 4 commits into
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #173
…tion - Added comprehensive documentation to Each method implementations explaining that Constants.Null (value 0) is treated as literal link index 0, not as wildcard - Clarified that Constants.Any should be used for wildcard/unspecified behavior - Added ILinksEachClarificationExtensions with helper methods for clearer API usage - Added comprehensive tests documenting expected behavior with null values - Resolves Issue #173: Define Each behaviour when Null (0) or default value is passed as restrictions The solution takes a conservative approach, preserving existing functionality while adding clarity through documentation and optional helper extensions. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>'
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.
Summary
Clarifies the Each method behavior when Constants.Null (value 0) is passed as restriction parameters to resolve the confusing behavior described in Issue #173.
Problem
The existing Each method behavior was confusing when Constants.Null (which has value 0) was passed as a restriction parameter. Users expected wildcard behavior but got literal index 0 lookup instead.
Solution
Conservative approach that preserves existing functionality while adding clarity:
Enhanced Documentation: Added comprehensive XML documentation to Each method implementations explaining that:
Clarification Extensions: Added
ILinksEachClarificationExtensionswith helper methods:EachAllLinks()- Clear method for iterating all linksEachAnyLink()- Explicit wildcard behavior using Constants.AnyEachLinkAtIndexZero()- Explicit method for finding link at index 0EachWithNullValidation()- Validation method that warns about potential Constants.Null misuseComprehensive Tests: Added
EachNullBehaviorTeststhat document and verify the expected behavior:Backward Compatibility
✅ No breaking changes - all existing code continues to work exactly as before.
Key Benefits
Test plan
Fixes #173
🤖 Generated with Claude Code