Skip to content

Commit 9d39b8c

Browse files
committed
docs: fix precision-remeasure/field-notes wording per CodeRabbit review
Two wording inaccuracies flagged on PR #242, both verified against frontend/roslyn/OwnSharp.Extractor/Program.cs HasEmptyDisposeBody: - The #240 gate matches only the generic System.Collections.Generic. IEnumerator<T> (checked by name + TypeArguments.Length == 1 + namespace), not the non-generic System.Collections.IEnumerator. Fixed in both docs/notes/field-notes-patterns.md entry 19 and docs/notes/precision-remeasure-2026-07-11.md's resolution addendum. - DisposeAsync() is not "recognized as empty" — any IAsyncDisposable or bare DisposeAsync (declared, explicit-impl, or inherited) disqualifies the exemption outright. Only explicit-interface synchronous Dispose() is recognized as empty (the actual #238 coverage-gap fix).
1 parent c4d8ba4 commit 9d39b8c

2 files changed

Lines changed: 19 additions & 11 deletions

File tree

‎docs/notes/field-notes-patterns.md‎

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -720,15 +720,22 @@ class"), so it was treated as a bug, not a precision tweak.
720720

721721
The fix (#240) **narrowed** the gate rather than special-casing weavers:
722722
`HasEmptyDisposeBody`'s exemption now applies **only** to types that
723-
implement `IEnumerator`/`IEnumerator<T>` — the one interface that *forces*
724-
a (frequently no-op) `Dispose()` implementation, which was the entire
725-
motivating shape for #225 in the first place. `XLWorkbook` and every other
726-
weaver-augmented domain type fall outside the gate and keep the honest
727-
warning. Defense in depth: a `FodyWeavers.xml` found above the source (or
728-
above the owning project, for linked sources) disables the exemption even
729-
for a qualifying enumerator. Explicit-interface `Dispose()`/`DisposeAsync()`
730-
are now recognized as empty too (closing the coverage gap that left 3 of 5
731-
`Slice.cs` sites unexempted). Two review rounds closed further soundness
723+
implement the *generic* `System.Collections.Generic.IEnumerator<T>` — the
724+
one interface that *forces* a (frequently no-op) `Dispose()` implementation
725+
via `IEnumerator<T> : IEnumerator, IDisposable`, which was the entire
726+
motivating shape for #225 in the first place. The non-generic
727+
`System.Collections.IEnumerator` does **not** extend `IDisposable`, so it
728+
does not qualify. `XLWorkbook` and every other weaver-augmented domain type
729+
fall outside the gate and keep the honest warning. Defense in depth: a
730+
`FodyWeavers.xml` found above the source (or above the owning project, for
731+
linked sources) disables the exemption even for a qualifying enumerator.
732+
Explicit-interface `Dispose()` is now recognized as empty too (closing the
733+
coverage gap that left 3 of 5 `Slice.cs` sites unexempted) — `DisposeAsync()`
734+
is the opposite of an exemption: ANY `IAsyncDisposable` (declared or
735+
inherited) or bare `DisposeAsync()` method (declared, explicit-impl, or
736+
inherited from a base) unconditionally **disqualifies** the exemption, since
737+
async disposal means the type is no longer the "simple enumerator holding
738+
nothing" the rule is scoped to. Two review rounds closed further soundness
732739
holes: inherited `IAsyncDisposable` (via `AllInterfaces`), inherited bare
733740
`DisposeAsync` (via base-chain walk), a sticky static-registry cache, and a
734741
fail-open weaver-detection path (`File.GetAttributes` instead of
@@ -739,7 +746,7 @@ for the full record — this is a deliberate historical lesson, not
739746
cleaned up: **source-level emptiness is not a runtime no-op once a
740747
compile-time IL weaver is in play, and a broad "any empty Dispose" gate
741748
cannot rule that out — only a gate scoped to a specific
742-
compiler/language-forced shape (here: `IEnumerator`) can.**
749+
compiler/language-forced shape (here: `IEnumerator<T>`) can.**
743750

744751
---
745752

‎docs/notes/precision-remeasure-2026-07-11.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ regression — item 2 above, the ClosedXML 263-finding over-exemption) with
223223
the explicit-interface coverage gap (item 1 above) folded into the same
224224
fix, closed by [PR #240](https://github.com/PhysShell/Own.NET/pull/240).
225225
The shipped fix took the narrowing direction (confine the exemption to
226-
`IEnumerator`-implementing types) rather than the weaver-convention-sniffing
226+
types implementing the generic `System.Collections.Generic.IEnumerator<T>`,
227+
not the non-generic `IEnumerator`) rather than the weaver-convention-sniffing
227228
heuristic sketched in item 2 — see
228229
`docs/notes/field-notes-patterns.md` entry 19 for the full account,
229230
including why the original "−5 Slice.cs points, 263 restored" acceptance

0 commit comments

Comments
 (0)