Define error-policy for wildcard no-match #38
Labels
No labels
bug
duplicate
enhancement/documentation
enhancement/feature
enhancement/organization
question
rejected
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
UserCurt/mpath#38
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The expected behavior is unclear when a data-derived matcher such as
DotGlobmatches no members withMissingPolicy="error".On the one hand, the wildcard correctly returns zero matches, and this could be considered successful and expected.
On the other hand, the user may have expected the wildcard to match something, and would expect an error otherwise (e.g., if they had a type). It could be surprising for
setandremovein particular to be a no-op because a wildcard did not match any fields. This is complicated by the fact that one branch may no matches while other branches have matches. Users may also have different expectations whether theDotGlobis a terminal operator or not.Examples
Terminal matcher
The wildcard is reached successfully but matches no members. This could be considered a successful empty query rather than an error.
Matcher before a required suffix
/Zexists, but*produces no branches on which/Bcan be traversed. This may warrant an error because the requested descendant target cannot be reached.Matcher after an earlier empty matcher
The first wildcard is reached and matches nothing. The second wildcard is never reached. This differs from a wildcard that is reached beneath an existing parent but finds no candidates.
Fixed in
b541c6f.