Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for UnconditionalSuppressMessageAttribute #43639

Closed
MichalStrehovsky opened this issue Apr 24, 2020 · 3 comments
Closed

Add support for UnconditionalSuppressMessageAttribute #43639

MichalStrehovsky opened this issue Apr 24, 2020 · 3 comments

Comments

@MichalStrehovsky
Copy link
Member

dotnet/runtime#35339 is adding a UnconditionalSuppressMessageAttribute that is pretty much the same thing as SuppressMessageAttribute, except it's not conditioned on CODE_ANALYSIS.

The purpose of the attribute is to allow suppression of messages from IL-level tools that operate on the whole program as opposed to source code (IL Linker being the main target for .NET 5).

The existing SuppressMessageAttribute doesn't typically get preserved into IL metadata since all the existing use cases for it are for source compilers only - it seems like it's desirable for it to stay like that.

It would be nice if Roslyn treated UnconditionalSuppressMessageAttribute same as SuppressMessageAttribute, since we're expecting there's going to be an overlap (the things that IL Linker is going to warn about in .NET 5 are also great candidates for Roslyn analyzers and code fixes). We cannot go with an analyzer-only approach for this though because Linker is analyzing code and generating warnings for e.g. NuGet packages too.

Cc @vitek-karas

@jinujoseph
Copy link
Contributor

cc @mavasani

@Youssef1313
Copy link
Member

Does #51792 fix this?

@MichalStrehovsky
Copy link
Member Author

Does #51792 fix this?

Yes, I think so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants