mirror of
https://github.com/icsharpcode/ILSpy.git
synced 2026-10-12 02:15:58 +00:00
Obfuscators strip the CompilerGeneratedAttribute and rewrite the "<caller>g__name|x_y" name, which is all IsLocalFunctionMethod had to go on. The method then stays an ordinary static method, its display struct escapes by ref into a plain call, and TransformDisplayClassUsage correctly refuses to scalar-replace it -- so the closure fields leak into the output as "<>c__DisplayClass29_0_.iid" (issue #3202). The one marker an obfuscator cannot remove is the signature: Roslyn emits struct closures exclusively for local functions, and no hand-written C# can name a "<>c__DisplayClass" type, so a by-ref parameter of one identifies the method regardless of what it is called. #3202 Assisted-by: Claude:claude-opus-5[1m]:Claude Code