fix(assert): adjust overload resolution priorities for dictionary and set assertions#4408
Conversation
SummaryThis PR fixes ambiguous overload resolution for types implementing both mutable and read-only collection interfaces (e.g., ImmutableHashSet) by adjusting overload resolution priorities. Critical IssuesNone found ✅ SuggestionsNone - the fix is minimal, targeted, and includes a proper regression test. AnalysisThe PR resolves the compilation error reported in #4406 by adjusting For Sets:
For Dictionaries (preventive fix):
This makes mutable interfaces (priority 3) preferred over read-only interfaces (priority 2) when types implement both, which is consistent and reasonable since mutable interfaces are more specific. Both Verdict✅ APPROVE - No critical issues |
SummaryFixes compilation error for types implementing both IReadOnlySet and ISet (like ImmutableHashSet) by adjusting overload resolution priorities. Critical IssuesNone found ✅ AnalysisThe PR correctly addresses issue #4406 by adjusting OverloadResolutionPriority attributes:
This ensures that when a type implements both interfaces (like ImmutableHashSet or ImmutableDictionary<K,V>), the more specific mutable interface overload is chosen, resolving the ambiguity. The changes follow TUnit rules:
Verdict✅ APPROVE - No critical issues |
Fixes #4406