-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
nullable switch no longer switches from warnings to errors #49392
Comments
I tried to reproduce and found that the command line build actually gave error diagnostics, but we still got warning diagnostics in the IDE. This might be an instance of #38371 |
It does sound odd that the combo box doesn't just enumerate the options which are available for the So I don't know what caused your combo box to be missing the "annotations" value. Also, this doc should clear up what "Enable" means versus "Warnings". |
Moving to IDE as this work sas expected in command line builds. |
@RikkiGibson , I am not saying my combo box is missing Annotations, I am saying my combo box (as yours) has two entries (among others) -- Enable and Warnings that behave the same, they result in Warnings. In order to trigger errors (now not working) you have to go somewhere else, and switch transition from warnings to errors. Just for the record, this was just a comment. The main point is there is problem with triggering errors. |
The core issue here is that the logic to map special warnaserror value "nullable" to actual nullable IDs is inside the C# command line parser, which will not be part of compilation options for all hosts except command line build: roslyn/src/Compilers/CSharp/Portable/CommandLine/CSharpCommandLineParser.cs Lines 1987 to 1996 in 823039e
This issue can be fixed in couple of possible ways:
Latter seems more preferable as it will implicitly fix all diagnostic hosts - though, I'll let the compiler team decide. Moving the issue back to Area-Compilers. |
thanks for the detailed analysis! |
O# is handling this by maintaining their own mapping - OmniSharp/omnisharp-roslyn#2406 - which is not ideal. |
In a way, a follow up to #41605
Version Used:
VS 2019 Pro Version 16.8.1
Steps to Reproduce:
Create Netstandard 2.1 project for example
Enable Nullable
Add "nullable" to WarningsAsErrors section, so with default values already present it shoudl be
<WarningsAsErrors>nullable;NU1605</WarningsAsErrors>
Expected Behavior:
Nullable errors.
Actual Behavior:
Nullable warnings.
Notes:
The text was updated successfully, but these errors were encountered: