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

Nullness - Consider supporting Nullable shorthand for TreatWarningsAsErrors #17524

Open
BoundedChenn31 opened this issue Aug 12, 2024 · 6 comments

Comments

@BoundedChenn31
Copy link
Contributor

BoundedChenn31 commented Aug 12, 2024

Is your feature request related to a problem? Please describe.

In C# it's possible to convert all nullable-related warnings to errors using <WarningsAsErrors>nullable</WarningsAsErrors>. From docs:
The set of all nullability warnings can be specified with the Nullable shorthand.

So in line with #17486 it would be nice to have WAE behaviour as well.

Describe the solution you'd like

Support <WarningsAsErrors>nullable</WarningsAsErrors>

Describe alternatives you've considered

Just use specific warning numbers or even true.

Additional context

.

@T-Gro
Copy link
Member

T-Gro commented Aug 14, 2024

So the nullable would be a shorthand for putting in all nullness-related errors, on top of the option for specifying error codes individually.

Do I understand it right?

@vzarytovskii
Copy link
Member

So the nullable would be a shorthand for putting in all nullness-related errors, on top of the option for specifying error codes individually.

Do I understand it right?

Yeah, I think that's what C# does currently.

@BoundedChenn31
Copy link
Contributor Author

So the nullable would be a shorthand for putting in all nullness-related errors, on top of the option for specifying error codes individually.

Do I understand it right?

Yes, not sure about implementation details (csc also supports /warnaserror:nullable option, so maybe it's handled completely by roslyn) but it definitely behaves like that and recommended as a solution:

SO: How to treat ALL C# 8 nullable reference warnings as errors?
Roslyn 1: Provide single option to treat nullable issues as errors not warnings
Roslyn 2: Proposal: Add switch for treating nullable-related warnings as errors

@abonie
Copy link
Member

abonie commented Sep 24, 2024

It's done, reopen if you still see it with F# 9

@T-Gro
Copy link
Member

T-Gro commented Sep 25, 2024

This was not done, this proposal is about a syntactical shorthand for doing warningsAsErrors for all nullable-related warnings. (as opposed to listing individual error codes)

@T-Gro T-Gro reopened this Sep 25, 2024
@vzarytovskii
Copy link
Member

I thought that we did it already for some reason

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

No branches or pull requests

4 participants