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

FS-1146-scoped-nowarn RFC proposal #782

Merged
merged 20 commits into from
Feb 12, 2025
Merged

Conversation

Martin521
Copy link
Contributor

@Martin521 Martin521 commented Aug 7, 2024

RFC proposal for scoped nowarn.
Click here to view the latest version.
For discussions, #786 has been started.

@Martin521 Martin521 marked this pull request as draft August 7, 2024 21:12
@Martin521 Martin521 mentioned this pull request Aug 9, 2024
22 tasks
@Martin521 Martin521 changed the title FS-1146-scoped-nowarn initial RFC doc FS-1146-scoped-nowarn RFC proposal Aug 19, 2024
@Martin521
Copy link
Contributor Author

Martin521 commented Aug 19, 2024

So, here is a full proposal.
Feedback is appreciated. Either in the discussion #786, or per review.

@Martin521 Martin521 marked this pull request as ready for review August 19, 2024 15:18
@T-Gro
Copy link
Contributor

T-Gro commented Sep 13, 2024

Heads up:

The following section will need a rewrite showing the logic and a few samples (I assume those can be taken from tests from the implementation PR once it lands):

https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/compiler-directives#preprocessor-directives

@Martin521
Copy link
Contributor Author

Can this PR be merged?
It is still a draft then and can still be changed, but at least we have a starting point.

@Martin521 Martin521 mentioned this pull request Nov 22, 2024
3 tasks
@dsyme
Copy link
Contributor

dsyme commented Jan 19, 2025

@T-Gro @vzarytovskii If you get a chance could you assess and merge if you see fit? thanks


2. `#warnon` shall have warning numbers as arguments in the same way as `#nowarn` (including non-string arguments (RFC-1147)).

> *Note:* Legacy oddities such as warning numbers in triple-quoted strings shall continue to be valid, for compatibility reasons. However, "multiline #nowarn" (with indented warning numbers in the following lines) is considered a bug and will not be supported any more, because it is against the spec and totally against the idea of pragmas. Tools must be able to easily interpret pragmas. Also, spaces between the hash sign and the nowarn/warnon (line `# nowarn 25`) shall not be allowed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this affect also code targetting langversion:9 and lower?

If there are more decisions like this, it would be good to have them all consolidated in a single paragraph which can then become part of the release notes, including examples.

(i.e. would prefer to have all changes of behavior for correct and incorrect code samples prepared in a single place now)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I consolidated all compatibility items in one section.


# Detailed specification

1. The compiler shall recognize a new *compiler directive* `#warnon` (to be added to §12.4 of the F# spec).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last section of the RFC mentions all the places that I found.
This includes a small entry in the formatting guidelines.

@T-Gro
Copy link
Contributor

T-Gro commented Feb 12, 2025

This RFC looks good, it can be merged - the remaining comments are about preparing explicit single-place documentation for breaking changes.

@Martin521
Copy link
Contributor Author

Thanks.
The PR targets now the folder draft. Is that correct? Or should it be RFCs? Or preview?

@T-Gro
Copy link
Contributor

T-Gro commented Feb 12, 2025

Draft was OK initially, but please move it to https://github.com/fsharp/fslang-design/tree/main/RFCs now.

@Martin521
Copy link
Contributor Author

done

@T-Gro T-Gro merged commit 4c74101 into fsharp:main Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants