F# Interactive has various options including one to suppress compiler warning messages:
--nowarn:<warning-list>
For more details see:
/nowarn (C# Compiler Options)
As an example:
match [] with | a::b -> 0
F# Interactive returns
Script.fsx(9,7): warning FS0025: Incomplete pattern matches on this expression.
For example, the value '[]' may indicate a case not covered by the pattern(s).
Microsoft.FSharp.Core.MatchFailureException:
The match cases were incomplete at <StartupCode$FSI_0003>.$FSI_0003.main@() in
C:\Users\Eric\Documents\Visual Studio2015\Projects\Workspace\Library2\Script.fsx:line 9
Stopped due to error
For
#nowarn "25"
match [] with | a::b -> 0
F# Interactive returns
Microsoft.FSharp.Core.MatchFailureException:
The match cases were incomplete at <StartupCode$FSI_0004>.$FSI_0004.main@() in
C:\Users\Eric\Documents\Visual Studio 2015\Projects\Workspace\Library2\Script.fsx:line 9
Stopped due to error
Notice the warning is now gone.
To use nowarn
you need to know the warning number which are like:
warning FS0025
It is the last digits of the warning code that you want to use with #nowarn
and do not forget the quotes around the number.
So for FS0025 it is #nowarn "25"