Open
Description
When you use a compiler directive, specifically #nowarn
, inside a module, the message is "Directives inside modules are ignored". This message is incomplete and it takes some experimenting to find out its statement is usually not true.
Repro steps
Take the following code:
module XBar =
#nowarn "test"
#if FALSE
module other =
let x = 12
#endif
This will show a warning for the first directive, but not the second:
Expected behavior
The warning should be more specific, I think it essentially only applies to #nowarn
directives?
Actual behavior
Regardless of the warning, the directive #if
is obeyed, as is #line
and perhaps others (but #nowarn
is not, but this is a known limitation and by design).
Known workarounds
Just learn to not be too alarmed by this all-too-generic warning :).
Related information
This behavior can be seen on all versions of F# and VS, at least back to VS2015 and F# 4.0.
Metadata
Metadata
Assignees
Type
Projects
Status
In Progress