Allow F# compiler directives like #nowarn to span less than an entire file.
A possibly related issue / suggestion is listed here:
Hater Dabber commented
I can't believe this feature is not in F# yet. It would be so useful for intentionally incomplete matches.
Mark Seemann commented
In C#, this feature exists, and has the following form:
#pragma warning disable 618
#pragma warning enable 618
This enables you to suppress specific compiler warnings locally, which is quite important for evolving APIs: sometimes you need to deprecate a particular API (function, type), but keep it around for backwards compatibility. This means that your own code may still need to use the deprecated code for a while longer (for e.g. unit tests), so it'd be nice to enable that scenario without suppressing all other warnings.
exercitus vir commented
You could use #endnowarn "[number]" to explicitely end a compiler directive.