diff --git a/FSharpBuild.Directory.Build.props b/FSharpBuild.Directory.Build.props
index 1b7ecd6fa27..33772456e28 100644
--- a/FSharpBuild.Directory.Build.props
+++ b/FSharpBuild.Directory.Build.props
@@ -28,7 +28,7 @@
$(ArtifactsDir)\Bootstrap
4.4.0
$(WarnOn);1182
- 0025;$(WarningsAsErrors)
+ 1182;0025;$(WarningsAsErrors)
$(OtherFlags) --nowarn:3384
$(OtherFlags) --times --nowarn:75
$(OtherFlags) $(AdditionalFscCmdFlags)
diff --git a/buildtools/fslex/fslex.fsproj b/buildtools/fslex/fslex.fsproj
index b450de1668d..684fecb11da 100644
--- a/buildtools/fslex/fslex.fsproj
+++ b/buildtools/fslex/fslex.fsproj
@@ -5,7 +5,8 @@
$(FSharpNetCoreProductTargetFramework)
true
LatestMajor
- $(NoWarn);64;1182;1204
+ $(NoWarn);64;1204;1182
+ $(OtherFlags) --warnaserror-:1182
diff --git a/buildtools/fsyacc/fsyacc.fsproj b/buildtools/fsyacc/fsyacc.fsproj
index 5f97b762e03..38280006de3 100644
--- a/buildtools/fsyacc/fsyacc.fsproj
+++ b/buildtools/fsyacc/fsyacc.fsproj
@@ -5,7 +5,8 @@
$(FSharpNetCoreProductTargetFramework)
true
LatestMajor
- $(NoWarn);64;1182;1204
+ $(NoWarn);64;1204;1182
+ $(OtherFlags) --warnaserror-:1182
diff --git a/tests/FSharp.Compiler.Service.Tests/EditorTests.fs b/tests/FSharp.Compiler.Service.Tests/EditorTests.fs
index bc6ad3d3e88..6ac0789cd9c 100644
--- a/tests/FSharp.Compiler.Service.Tests/EditorTests.fs
+++ b/tests/FSharp.Compiler.Service.Tests/EditorTests.fs
@@ -9,6 +9,8 @@ open FSharp.Compiler.Symbols
open FSharp.Compiler.Text
open FSharp.Compiler.Tokenization
+#nowarn "1182" // Unused bindings when ignored parsed results etc.
+
let stringMethods =
[
"Chars"; "Clone"; "CompareTo"; "Contains"; "CopyTo"; "EndsWith";
diff --git a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj
index 16e9df837ee..1cf8d9c720b 100644
--- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj
+++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj
@@ -6,6 +6,7 @@
$(FSharpNetCoreProductTargetFramework)
true
$(NoWarn);1182
+ $(OtherFlags) --warnaserror-:1182
true
xunit
diff --git a/tests/FSharp.Compiler.Service.Tests/MultiProjectAnalysisTests.fs b/tests/FSharp.Compiler.Service.Tests/MultiProjectAnalysisTests.fs
index ee6b23794b1..b553d676cb3 100644
--- a/tests/FSharp.Compiler.Service.Tests/MultiProjectAnalysisTests.fs
+++ b/tests/FSharp.Compiler.Service.Tests/MultiProjectAnalysisTests.fs
@@ -13,6 +13,8 @@ open FSharp.Compiler.Text
open FSharp.Compiler.Service.Tests.Common
open TestFramework
+#nowarn "1182" // Unused bindings when ignored parsed results etc.
+
let toIList (x: _ array) = x :> IList<_>
let numProjectsForStressTest = 100
let internal checker = FSharpChecker.Create(projectCacheSize=numProjectsForStressTest + 10, useTransparentCompiler = CompilerAssertHelpers.UseTransparentCompiler)
diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj b/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj
index f5737066162..d4dbfdd4348 100644
--- a/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj
+++ b/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj
@@ -13,7 +13,7 @@
true
preview
$(NoWarn);1182
-
+ $(OtherFlags) --warnaserror-:1182
true
xunit
true
diff --git a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj
index 21305e52a5d..cc40ac675c7 100644
--- a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj
+++ b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj
@@ -6,7 +6,7 @@
Library
$(NoWarn);47;75;1182
true
- $(OtherFlags) --subsystemversion:6.00
+ $(OtherFlags) --subsystemversion:6.00 --warnaserror-:1182
false
diff --git a/vsintegration/src/FSharp.VS.FSI/sessions.fs b/vsintegration/src/FSharp.VS.FSI/sessions.fs
index d46e963015e..ca2c980f553 100644
--- a/vsintegration/src/FSharp.VS.FSI/sessions.fs
+++ b/vsintegration/src/FSharp.VS.FSI/sessions.fs
@@ -41,7 +41,7 @@ type internal EventWrapper() =
/// Run function application return Some (f x) or None if execution exceeds timeout (in ms).
/// Exceptions raised by f x are caught and reported in DEBUG mode.
-let timeoutApp descr timeoutMS (f : 'a -> 'b) (arg:'a) =
+let timeoutApp _descr timeoutMS (f : 'a -> 'b) (arg:'a) =
use ev = new EventWrapper()
let mutable r = None
ThreadPool.QueueUserWorkItem(fun _ ->
@@ -57,7 +57,7 @@ let timeoutApp descr timeoutMS (f : 'a -> 'b) (arg:'a) =
"fsi.exe starts the remoting server at the end of it's initialisation sequence.\n" +
"The initialisation sequence takes an observable time (e.g. 2 seconds).\n" +
"Remoting exceptions are to be expected on interrupt/intellisense calls made before that point.\n" +
- "Context: " + descr + "\n" +
+ "Context: " + _descr + "\n" +
"Exception: " + e.ToString()) |> ignore
#endif
None
@@ -285,7 +285,7 @@ let fsiStartInfo channelName sourceFile =
procInfo
-let nonNull = function null -> false | (s:string) -> true
+let nonNull = function null -> false | (_:string) -> true
/// Represents an active F# Interactive process to which Visual Studio is connected via stdin/stdout/stderr and a remoting channel
type FsiSession(sourceFile) =
diff --git a/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj b/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj
index ae81965ef4c..faca7cb840b 100644
--- a/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj
+++ b/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj
@@ -5,7 +5,7 @@
net472
true
- $(OtherFlags) --nowarn:3390 --nowarn:3218 --nowarn:1182
+ $(OtherFlags) --nowarn:3390 --nowarn:3218 --nowarn:1182 --warnaserror-:1182
diff --git a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj
index 4e556083776..7f24444a6e5 100644
--- a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj
+++ b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj
@@ -5,6 +5,7 @@
Library
$(NoWarn);44;45;47;52;58;75;1182
+ $(OtherFlags) --warnaserror-:1182
true
true
false
diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj
index 4020cfd750d..77c7d12e017 100644
--- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj
+++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj
@@ -7,6 +7,7 @@
x86
Library
$(NoWarn);44;58;75;3005;1182
+ $(OtherFlags) --warnaserror-:1182
true
true
true