Repository navigation
Commit 0cc0d5b
committed
fix(extractor): make IsStaticHandler resolve member-group symbols; drop static-class escape suppression (Codex)
Codex P2: blanket-suppressing OWN014 for ALL static-source subscriptions in a static class is
unsound — a CAPTURING lambda still retains its compiler-generated display-class instance for the
process, even with no `this`. Codex's pointer is right: the mined case (MemoryAllocatorValidator)
uses static-METHOD handlers, which the existing IsStaticHandler is meant to exempt; it missed them
because a method group's symbol can surface as a member group (Symbol == null, CandidateSymbols
populated).
So: make IsStaticHandler fall back to CandidateSymbols (requiring ALL candidates static, so a
mixed overload set is not wrongly exempted), and revert the static-class suppression entirely. A
static-method handler in a static class is now exempted by IsStaticHandler (null target, no
instance), while a capturing lambda there still escapes — sound.
Sample now uses a static-METHOD handler on a static event from a static class's static ctor
(replicating MemoryAllocatorValidator) and must stay silent; StaticEventEscapeViewModel still
proves an instance handler on a static event escapes.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rg8kSk1YT14x7A1vo5zgED1 parent 8e80d66 commit 0cc0d5b
3 files changed
Lines changed: 38 additions & 31 deletions
File tree
- .github/workflows
- frontend/roslyn
- OwnSharp.Extractor
- samples
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
329 | 330 | | |
330 | | - | |
| 331 | + | |
331 | 332 | | |
332 | 333 | | |
333 | 334 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
192 | 205 | | |
193 | 206 | | |
194 | 207 | | |
| |||
2043 | 2056 | | |
2044 | 2057 | | |
2045 | 2058 | | |
2046 | | - | |
2047 | | - | |
2048 | | - | |
2049 | | - | |
2050 | | - | |
2051 | 2059 | | |
2052 | 2060 | | |
2053 | 2061 | | |
| |||
2081 | 2089 | | |
2082 | 2090 | | |
2083 | 2091 | | |
2084 | | - | |
2085 | | - | |
2086 | | - | |
2087 | | - | |
2088 | | - | |
2089 | | - | |
2090 | | - | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
2091 | 2098 | | |
2092 | 2099 | | |
2093 | 2100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | | - | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | | - | |
| 25 | + | |
27 | 26 | | |
28 | 27 | | |
29 | | - | |
| 28 | + | |
30 | 29 | | |
0 commit comments