Skip to content

Conversation

@sbomer
Copy link
Member

@sbomer sbomer commented Mar 17, 2022

Instead of computing the suppression context member when we push to the scope stack, it is now computed on demand when we need to know whether a warning is suppressed. The suppression context should be entirely determined by the static scopes, so there isn't any need to track it dynamically.

This will make it easier to add support for suppressions on local functions and lambdas, where we need to walk up multiple enclosing lambdas or local functions, each of which could be a suppression context.

@sbomer sbomer requested a review from marek-safar as a code owner March 17, 2022 16:41
@sbomer sbomer requested a review from vitek-karas March 17, 2022 16:41
Copy link
Member

@vitek-karas vitek-karas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason I'm nervous about this change... but I can't find anything wrong with it.
Looks good.

@sbomer
Copy link
Member Author

sbomer commented Mar 18, 2022

Yeah, the suppression logic has bugs in the past so I made this a separate change just to get more eyes on it. Thanks!

@sbomer sbomer merged commit 2303da0 into dotnet:main Mar 18, 2022
@sbomer sbomer deleted the removeSuppressionContext branch April 14, 2022 18:33
agocke pushed a commit to dotnet/runtime that referenced this pull request Nov 16, 2022
* Remove SuppressionContextMember

Instead of computing the suppression context member when we push to the scope stack, it is now computed on demand when we need to know whether a warning is suppressed. The suppression context should be entirely determined by the static scopes, so there isn't any need to track it dynamically.

Commit migrated from dotnet/linker@2303da0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants