Skip to content

Commit 7f39a7d

Browse files
committed
fix(extractor): match only bare/System.IO.Pipelines-qualified PipeReader/PipeWriter (Codex)
Codex: stripping the namespace excluded any type whose simple name is PipeReader/PipeWriter, so a project's own disposable `MyLib.PipeReader` would be silently dropped (a false negative). Match the exact bare or `System.IO.Pipelines`-qualified spelling instead; the bare spelling (the mined FP and the regression sample) stays excluded, a differently-namespaced type does not. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rg8kSk1YT14x7A1vo5zgED
1 parent 7a607a7 commit 7f39a7d

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎frontend/roslyn/OwnSharp.Extractor/Program.cs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,10 +1420,11 @@ t is "IDisposable" or "IAsyncDisposable" or "CancellationTokenSource"
14201420
// IDisposable: System.IO.Pipelines `PipeReader`/`PipeWriter` finish via `Complete()`, not `Dispose()`.
14211421
// Excluding them stops the field-disposable detector flagging an undisposed PipeReader/PipeWriter
14221422
// field as a leak — a FALSE POSITIVE mined on Pipelines.Sockets.Unofficial (SocketConnection's
1423-
// `_input`/`_output`). Matched on the SIMPLE name so a qualified `System.IO.Pipelines.PipeReader`
1424-
// is covered too.
1423+
// `_input`/`_output`). Matched on the exact bare or `System.IO.Pipelines`-qualified spelling — NOT
1424+
// any simple-name match, so a project's own disposable `MyLib.PipeReader` is still flagged (Codex).
14251425
static bool IsNonDisposableReaderWriter(string t) =>
1426-
(t.Contains('.') ? t[(t.LastIndexOf('.') + 1)..] : t) is "PipeReader" or "PipeWriter";
1426+
t is "PipeReader" or "PipeWriter"
1427+
or "System.IO.Pipelines.PipeReader" or "System.IO.Pipelines.PipeWriter";
14271428

14281429
// --- P-006: DI registration + constructor graph (DI001 captive dependency) ---
14291430
// A syntactic pass over the same trees, independent of the event/disposable

0 commit comments

Comments
 (0)