-
Notifications
You must be signed in to change notification settings - Fork 786
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
warnings for invalid #nowarn arguments #17870
Labels
Milestone
Comments
2 tasks
If you compile the second file under SDK 8.0.xxx (i.e. with the "real" F# 8.0 compiler), you get a FS0203 and a FS0020, like in the IDE. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Working on "scoped nowarn", I came across the following items.
With SDK 8.0, a directive
#nowarn "FS0020"
creates a warning "Invalid warning number 'FS0020'".With the current compiler and "--langversion:8.0", there is no warning. (It got lost in Allow ParsedHashDirectives to take non string arguments #17206.)
The warning should be brought back for "--langversion:8.0".
I also propose to introduces (under the F# 9.0 language flag
ParsedHashDirectiveArgumentNonQuotes
) warnings for invalid nowarn arguments like in#nowarn "xyz"
. Specifically, for arguments that do not match the format(FS)?\d+
(for directives) or[A-Z]*\d+
(for compiler options).Independent of the language version, the range of the argument (rather than the whole directive) should be used for the warning, making it more precise.
Draft PR exists (#17871)
The text was updated successfully, but these errors were encountered: