You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
Inconsistent suppression behavior for nested functions #2727
For this reason the linker will not try to associate local functions with the immediately containing local function - instead it will only associate local functions with the containing user method. However, the analyzer does consider suppressions from enclosing local functions. So one question is whether the analyzer should behave more like the linker by only "inheriting" suppressions from the containing user method.
It might be possible to do better for cases where they capture enclosing state - there we could potentially infer the nesting from what got captured - but this would mean more reliance on compiler implementation details.
This is only really an issue for local functions. We could do better for lambdas since the IL will always have an actual reference to the generated lambda method at the point where it is defined. It's debatable whether we should implement better understanding of nested lambdas, or leave lambdas with the same limitation for consistency with local functions.
Activity