-
Notifications
You must be signed in to change notification settings - Fork 847
Description
(edited, it is not related to --warnon, but to --warnaserrors)
If you have --warnaserror:xxxx, and on file-level you disable that same warning, you still see the errors in that file, while the compiler succeeds. This is confusing.
Repro steps (1)
- Add "25" to the Warnings as errors:

- Add
#nowarn "25"to a source file. - Write code that triggers this warning:

Repro steps (2)
- Add
warnon:1182in project settings:

- Add
FS1182to the "warnings as errors":

- Inside a source file, add
#nowarn:1182at the top - Have a line with an unused variable
Expected behavior
Inside a file, the editor should consider the #nowarn directives.
Actual behavior
Apparently, the editor highlighting tooling is aware of the --warnaserror compiler option, but not of the #nowarn directive in the file, and shows the error, while fsc doesn't show an error.
- It shouldn't show the red squiggles
- It should (probably) still show the "unused" warning in the mouseover
- It should keep the ident greyed out
Known workarounds
Don't use these options, or fix your errors. But as seen in #9795, that's not always possible.
Related information
- It doesn't matter whether you use the UI setting, or add
--warnaserror:XXXXto the addition fsc options
Not really related anymore, but FYI, since 1182 is a "special" warning that does not get triggered on any warning level, unless you add the --warnon:XXXX to the options.
In this reaction, back in 2015 (!) (#422 (comment)), @dsyme mentions that opt-in for FS1182 was deliberate. It was done before moving to github, so I cannot find the decision/discussion or changes.
Yes, I do recall this, it's good to have it recorded (and yes, this was one of the reasons /warn:1182 was made opt-in)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
