Skip to content

Base Slice equality on the identifier alone - #507

Merged
alexanderlinne merged 1 commit into
mainfrom
fix/slice-identifier-equality
Oct 9, 2026
Merged

alexanderlinne merged 1 commit into
mainfrom
fix/slice-identifier-equality

Conversation

@alexanderlinne

Copy link
Copy Markdown
Collaborator

Slice.Equals also compared Types, and IEnumerable has reference equality, so two slices built from the same identifier over equal but distinct sequences compared as different. A slice is defined by its identifier - the types are derived from it - so comparing them adds nothing but the reference-identity trap.

This matters because PlantUmlFileBuilder calls slices.Distinct() and the freeze store deduplicates violations by slice.

Slice.Equals also compared Types, and IEnumerable<IType> has reference
equality, so two slices built from the same identifier over equal but
distinct sequences compared as different. A slice is defined by its
identifier - the types are derived from it - so comparing them adds
nothing but the reference-identity trap.

This matters because PlantUmlFileBuilder calls slices.Distinct() and the
freeze store deduplicates violations by slice.

Signed-off-by: Alexander Linne <alexander.linne@tngtech.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.25%. Comparing base (1ab884d) to head (e6bd0d6).

Files with missing lines Patch % Lines
ArchUnitNET/Domain/Slice.cs 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #507      +/-   ##
==========================================
- Coverage   86.25%   86.25%   -0.01%     
==========================================
  Files         260      260              
  Lines       12498    12496       -2     
  Branches     1219     1218       -1     
==========================================
- Hits        10780    10778       -2     
  Misses       1379     1379              
  Partials      339      339              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alexanderlinne
alexanderlinne merged commit b90409d into main Oct 9, 2026
10 checks passed
@alexanderlinne
alexanderlinne deleted the fix/slice-identifier-equality branch October 9, 2026 09:19
This was referenced Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants