-
Notifications
You must be signed in to change notification settings - Fork 803
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
#nowarn “2003” doesn't disable FS2003 #3139
Comments
@cartermp Any ideas? |
I can repro, though I'm not sure what the root cause is here. I suspect it's a compiler issue, but I haven't debugged it. |
Yeah, it's a compiler issue. The version information is checked before the scope pragma filters are in place |
Interestingly I cannot reproduce with the above code and a standalone Reproduces via namespace System
open System.Reflection
#nowarn "2003"
[<assembly: AssemblyVersionAttribute("5.0.0")>]
[<assembly: AssemblyInformationalVersion("5.0.0-beta024")>]
do () Seems like |
- Make sure the warning is triggered always (not only when AssemblyVersionAttribute is present) - Make sure warning can be disabled via #nowarn 2003 - Include the correct range of the problematic string
* Fix issue #3139, - Make sure the warning is triggered always (not only when AssemblyVersionAttribute is present) - Make sure warning can be disabled via #nowarn 2003 - Include the correct range of the problematic string * add missing test-files. * edit existing tests * do not use full-qualified type name when reporting errors (as it was previously). * use full name and wait for feedback * Add comments as suggested. * Change warning message slightly as suggested by @dsyme . * Fix english localization. * update test
The repro code, below, compiled in a fresh console project in VS2017 (v15.2), fails to suppress the FS2003 warning (which the
#nowarn
directive should suppress). I'm targeting F# 4.1 (FSharp.Core 4.4.1.0).We compile with "warnings as errors," so this is a strong issue. This is to be used in generated code, so
#nowarn
is far preferable to editing every F# project.Repro steps
Provide the steps required to reproduce the problem
Create an F# console project with VS2017.
Replace the program code with the code below.
Build
Expected behavior
No FS2003 warning should be generated.
Actual behavior
An FS2003 warning was generated.
FSC: warning FS2003: An System.Reflection.AssemblyInformationalVersionAttribute specified version '13.3.1.74-g5224f3b', but this value is invalid and has been ignored
Known workarounds
Hand edit all your VS F# projects to ignore the warning in the project properties page. (Ew.)
Related information
All testing was on .NET Framework 4.5 and 4.6.2 on Windows 10. Reproduces with both F# 4.0 and 4.1.
Also brought up on https://stackoverflow.com/q/44187146/83202
The text was updated successfully, but these errors were encountered: