diff --git a/FSharpBuild.Directory.Build.props b/FSharpBuild.Directory.Build.props
index bcdbffa1c12..d06631f786c 100644
--- a/FSharpBuild.Directory.Build.props
+++ b/FSharpBuild.Directory.Build.props
@@ -19,8 +19,8 @@
$(ArtifactsDir)\SymStore
$(ArtifactsDir)\Bootstrap
4.4.0
- 1182;0025;$(WarningsAsErrors)
- $(OtherFlags) --nowarn:3384
+ 0025;$(WarningsAsErrors)
+ $(OtherFlags) --warnaserror --nowarn:3384
diff --git a/src/fsharp/CompilerDiagnostics.fs b/src/fsharp/CompilerDiagnostics.fs
index 2006048da01..a24ea8b7bf8 100644
--- a/src/fsharp/CompilerDiagnostics.fs
+++ b/src/fsharp/CompilerDiagnostics.fs
@@ -372,7 +372,6 @@ let warningOn err level specificWarnOn =
List.contains n specificWarnOn ||
// Some specific warnings are never on by default, i.e. unused variable warnings
match n with
- | 1182 -> false // chkUnusedValue - off by default
| 3180 -> false // abImplicitHeapAllocation - off by default
| 3517 -> false // optFailedToInlineSuggestedValue - off by default
| _ -> level >= GetWarningLevel err
diff --git a/src/fsharp/FSharp.Build/CreateFSharpManifestResourceName.fs b/src/fsharp/FSharp.Build/CreateFSharpManifestResourceName.fs
index e4defc092e6..1e981b88503 100644
--- a/src/fsharp/FSharp.Build/CreateFSharpManifestResourceName.fs
+++ b/src/fsharp/FSharp.Build/CreateFSharpManifestResourceName.fs
@@ -19,7 +19,7 @@ type CreateFSharpManifestResourceName public () =
(linkFileName:string),
(rootNamespace:string), (* may be null *)
(dependentUponFileName:string), (* may be null *)
- (binaryStream:System.IO.Stream) (* may be null *)) : string =
+ (_binaryStream:System.IO.Stream) (* may be null *)) : string =
// The Visual CSharp and XBuild CSharp toolchains transform resource names like this:
// SubDir\abc.resx --> SubDir.abc.resources
diff --git a/src/fsharp/FSharp.Build/FSharpEmbedResourceText.fs b/src/fsharp/FSharp.Build/FSharpEmbedResourceText.fs
index 1a8efbe5b66..8757106bc45 100644
--- a/src/fsharp/FSharp.Build/FSharpEmbedResourceText.fs
+++ b/src/fsharp/FSharp.Build/FSharpEmbedResourceText.fs
@@ -356,7 +356,7 @@ open Printf
printMessage (sprintf "Reading %s" filename)
let lines = File.ReadAllLines(filename)
|> Array.mapi (fun i s -> i,s) // keep line numbers
- |> Array.filter (fun (i,s) -> not(s.StartsWith "#")) // filter out comments
+ |> Array.filter (fun (_,s) -> not(s.StartsWith "#")) // filter out comments
printMessage (sprintf "Parsing %s" filename)
let stringInfos = lines |> Array.map (fun (i,s) -> ParseLine filename i s)
@@ -391,7 +391,7 @@ open Printf
printMessage (sprintf "Generating resource methods for %s" outFilename)
// gen each resource method
- stringInfos |> Seq.iter (fun (lineNum, (optErrNum,ident), str, holes, netFormatString) ->
+ stringInfos |> Seq.iter (fun (lineNum, (optErrNum,ident), str, holes, _) ->
let formalArgs = new System.Text.StringBuilder()
let actualArgs = new System.Text.StringBuilder()
let mutable firstTime = true
@@ -428,14 +428,14 @@ open Printf
// gen validation method
fprintfn out " /// Call this method once to validate that all known resources are valid; throws if not"
fprintfn out " static member RunStartupValidation() ="
- stringInfos |> Seq.iter (fun (lineNum, (optErrNum,ident), str, holes, netFormatString) ->
+ stringInfos |> Seq.iter (fun (_, (_,ident), _, _, _) ->
fprintfn out " ignore(GetString(\"%s\"))" ident
)
fprintfn out " ()" // in case there are 0 strings, we need the generated code to parse
// gen to resx
let xd = new System.Xml.XmlDocument()
xd.LoadXml(xmlBoilerPlateString)
- stringInfos |> Seq.iter (fun (lineNum, (optErrNum,ident), str, holes, netFormatString) ->
+ stringInfos |> Seq.iter (fun (_, (_,ident), _, _, netFormatString) ->
let xn = xd.CreateElement("data")
xn.SetAttribute("name",ident) |> ignore
xn.SetAttribute("xml:space","preserve") |> ignore
diff --git a/src/fsharp/FSharp.Build/Fsc.fs b/src/fsharp/FSharp.Build/Fsc.fs
index 42c980a9ce8..39304c25145 100644
--- a/src/fsharp/FSharp.Build/Fsc.fs
+++ b/src/fsharp/FSharp.Build/Fsc.fs
@@ -63,7 +63,6 @@ type public Fsc () as this =
let mutable tailcalls : bool = true
let mutable targetProfile : string = null
let mutable targetType : string = null
- let mutable toolExe : string = "fsc.exe"
let defaultToolPath =
let locationOfThisDll =
try Some(Path.GetDirectoryName(typeof.Assembly.Location))
@@ -577,7 +576,6 @@ type public Fsc () as this =
match host with
| null -> base.ExecuteTool(pathToTool, responseFileCommands, commandLineCommands)
| _ ->
- let sources = sources|>Array.map(fun i->i.ItemSpec)
let invokeCompiler baseCallDelegate =
try
let ret =
@@ -590,8 +588,8 @@ type public Fsc () as this =
// Do a string compare on the type name to do eliminate a compile time dependency on Microsoft.Build.dll
| :? TargetInvocationException as tie when not (isNull tie.InnerException) && (tie.InnerException).GetType().FullName = "Microsoft.Build.Exceptions.BuildAbortedException" ->
fsc.Log.LogError(tie.InnerException.Message, [| |])
- -1
- | e -> reraise()
+ -1 // ok, this is what happens when VS IDE cancels the build, no need to assert, just log the build-canceled error and return -1 to denote task failed
+ | _ -> reraise()
let baseCallDelegate = Func(fun () -> fsc.BaseExecuteTool(pathToTool, responseFileCommands, commandLineCommands) )
try
diff --git a/src/fsharp/FSharp.Build/Fsi.fs b/src/fsharp/FSharp.Build/Fsi.fs
index ffe833e0e01..c7b71c7c1d1 100644
--- a/src/fsharp/FSharp.Build/Fsi.fs
+++ b/src/fsharp/FSharp.Build/Fsi.fs
@@ -37,15 +37,12 @@ type public Fsi () as this =
let mutable provideCommandLineArgs = false
let mutable references : ITaskItem[] = [||]
let mutable referencePath : string = null
- let mutable resources : ITaskItem[] = [||]
let mutable skipCompilerExecution = false
let mutable sources : ITaskItem[] = [||]
let mutable loadSources : ITaskItem[] = [||]
let mutable useSources : ITaskItem[] = [||]
let mutable tailcalls : bool = true
let mutable targetProfile : string = null
- let mutable targetType : string = null
- let mutable toolExe : string = "fsi.exe"
let mutable toolPath : string =
let locationOfThisDll =
try Some(Path.GetDirectoryName(typeof.Assembly.Location))
@@ -85,11 +82,6 @@ type public Fsi () as this =
for item in references do
builder.AppendSwitchIfNotNull("-r:", item.ItemSpec)
- let referencePathArray = // create a array of strings
- match referencePath with
- | null -> null
- | _ -> referencePath.Split([|';'; ','|], StringSplitOptions.RemoveEmptyEntries)
-
// NoWarn
match disabledWarnings with
| null -> ()
@@ -293,7 +285,6 @@ type public Fsi () as this =
match host with
| null -> base.ExecuteTool(pathToTool, responseFileCommands, commandLineCommands)
| _ ->
- let sources = sources|>Array.map(fun i->i.ItemSpec)
let invokeCompiler baseCallDelegate =
try
let ret =
@@ -306,8 +297,8 @@ type public Fsi () as this =
// Do a string compare on the type name to do eliminate a compile time dependency on Microsoft.Build.dll
| :? TargetInvocationException as tie when not (isNull tie.InnerException) && (tie.InnerException).GetType().FullName = "Microsoft.Build.Exceptions.BuildAbortedException" ->
fsi.Log.LogError(tie.InnerException.Message, [| |])
- -1
- | e -> reraise()
+ -1 // ok, this is what happens when VS IDE cancels the build, no need to assert, just log the build-canceled error and return -1 to denote task failed
+ | _ -> reraise()
let baseCallDelegate = Func(fun () -> fsi.BaseExecuteTool(pathToTool, responseFileCommands, commandLineCommands) )
try
diff --git a/src/fsharp/FSharp.Build/MapSourceRoots.fs b/src/fsharp/FSharp.Build/MapSourceRoots.fs
index 84310352b8d..2d1b671bf54 100644
--- a/src/fsharp/FSharp.Build/MapSourceRoots.fs
+++ b/src/fsharp/FSharp.Build/MapSourceRoots.fs
@@ -122,7 +122,7 @@ type MapSourceRoots () =
for root in mappedSourceRoots do
match root.GetMetadata SourceControl with
- | HasValue v when isSourceControlled -> mapNestedRootIfEmpty root
+ | HasValue _ when isSourceControlled -> mapNestedRootIfEmpty root
| NullOrEmpty when not isSourceControlled -> mapNestedRootIfEmpty root
| _ -> ()
diff --git a/src/fsharp/FSharp.Compiler.Server.Shared/FSharpInteractiveServer.fs b/src/fsharp/FSharp.Compiler.Server.Shared/FSharpInteractiveServer.fs
index eca486f48cc..bc13218a5d8 100644
--- a/src/fsharp/FSharp.Compiler.Server.Shared/FSharpInteractiveServer.fs
+++ b/src/fsharp/FSharp.Compiler.Server.Shared/FSharpInteractiveServer.fs
@@ -37,7 +37,7 @@ type internal FSharpInteractiveServer() =
LifetimeServices.RenewOnCallTime <- TimeSpan(7,0,0,0);
LifetimeServices.SponsorshipTimeout <- TimeSpan(7,0,0,0);
ChannelServices.RegisterChannel(chan,false);
- let objRef = RemotingServices.Marshal(server,"FSIServer")
+ RemotingServices.Marshal(server,"FSIServer") |> ignore
()
static member StartClient(channelName) =
diff --git a/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj b/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj
index 2572d28cc62..69c05f34b17 100644
--- a/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj
+++ b/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj
@@ -8,6 +8,7 @@
Library
true
nunit
+ $(NoWarn);1182
diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/UnsupportedAttributes.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/UnsupportedAttributes.fs
index 439b0bd7bdb..9800bb3512c 100644
--- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/UnsupportedAttributes.fs
+++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/UnsupportedAttributes.fs
@@ -20,6 +20,7 @@ type C() =
member _.G() = ()
"""
|> FSharp
+ |> withOptions ["--nowarn:1182"]
|> typecheck
|> shouldFail
|> withResults [
diff --git a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/WarnExpressionTests.fs b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/WarnExpressionTests.fs
index 3e7768efb94..18f4c19fb1c 100644
--- a/tests/FSharp.Compiler.ComponentTests/ErrorMessages/WarnExpressionTests.fs
+++ b/tests/FSharp.Compiler.ComponentTests/ErrorMessages/WarnExpressionTests.fs
@@ -70,7 +70,7 @@ let changeProperty() =
[]
let ``Don't Warn If Property Without Setter``() =
FSharp """
-type MyClass(property1 : int) =
+type MyClass(_property1 : int) =
member val Property2 = "" with get
let x = MyClass(1)
diff --git a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Overload_Equals.fs b/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Overload_Equals.fs
index 5749edc7ef8..0e2822484c9 100644
--- a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Overload_Equals.fs
+++ b/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Overload_Equals.fs
@@ -4,9 +4,9 @@
type R =
{ x: int }
- member this.Equals(s:char) = true
+ member this.Equals(_:char) = true
// member this.Equals(s:R) = 1.
- member this.Equals(?s:char) = true
+ member this.Equals(?_s:char) = true
#if INTERACTIVE
exit 0;;
diff --git a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Overload_GetHashCode.fs b/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Overload_GetHashCode.fs
index 25aa07cd456..dddc506aa4f 100644
--- a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Overload_GetHashCode.fs
+++ b/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Overload_GetHashCode.fs
@@ -3,9 +3,9 @@
// Overloading of GetHashCode()
type R =
{ x: int }
- member this.GetHashCode(s:char) = 1
+ member this.GetHashCode(_s:char) = 1
//member this.GetHashCode() = 1.
- member this.GetHashCode(?s:char) = 1
+ member this.GetHashCode(?_s:char) = 1
#if INTERACTIVE
exit 0;;
diff --git a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Overload_ToString.fs b/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Overload_ToString.fs
index 2e651f776dd..cb3c47a39ac 100644
--- a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Overload_ToString.fs
+++ b/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Overload_ToString.fs
@@ -4,9 +4,9 @@
type R =
{ x: int }
- member this.ToString(s:char) = true
+ member this.ToString(_s:char) = true
member this.ToString() = true
- member this.ToString(?s:char) = true
+ member this.ToString(?_s:char) = true
#if INTERACTIVE
exit 0;;
diff --git a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Overload_Equals.fs b/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Overload_Equals.fs
index 0e289605e5a..7eab984dc44 100644
--- a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Overload_Equals.fs
+++ b/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Overload_Equals.fs
@@ -3,9 +3,9 @@
// Overloading of Equals()
type DU = | A
- member this.Equals(s:char) = true
+ member this.Equals(_s:char) = true
//member this.Equals(s:DU) = 1.
- member this.Equals(?s:char) = true
+ member this.Equals(?_s:char) = true
#if INTERACTIVE
exit 0;;
diff --git a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Overload_GetHashCode.fs b/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Overload_GetHashCode.fs
index f85e1c1dbd1..8e4d6dba20a 100644
--- a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Overload_GetHashCode.fs
+++ b/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Overload_GetHashCode.fs
@@ -3,9 +3,9 @@
// Overloading of GetHashCode()
type DU = | A
- member this.GetHashCode(s:char) = 1
+ member this.GetHashCode(_s:char) = 1
//member this.GetHashCode() = 1.
- member this.GetHashCode(?s:char) = 1
+ member this.GetHashCode(?_s:char) = 1
#if INTERACTIVE
exit 0;;
diff --git a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Overload_ToString.fs b/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Overload_ToString.fs
index 64400c453da..2e4b6e8d6d8 100644
--- a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Overload_ToString.fs
+++ b/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Overload_ToString.fs
@@ -3,9 +3,9 @@
// Overloading of ToString()
type DU = | A
- member this.ToString(s:char) = true
+ member this.ToString(_s:char) = true
member this.ToString() = true
- member this.ToString(?s:char) = true
+ member this.ToString(?_s:char) = true
#if INTERACTIVE
exit 0;;
diff --git a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/LexicalAnalysis/Shift/Generics/RightShift001.fs b/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/LexicalAnalysis/Shift/Generics/RightShift001.fs
index 251673d2e07..acea144b3cd 100644
--- a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/LexicalAnalysis/Shift/Generics/RightShift001.fs
+++ b/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/LexicalAnalysis/Shift/Generics/RightShift001.fs
@@ -9,4 +9,4 @@
type ID<'T> =
static member id (x:'T) = x
-let f x = ID>.id (* ok *)
+let f _x = ID>.id (* ok *)
diff --git a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/LexicalAnalysis/Shift/Generics/RightShift002.fs b/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/LexicalAnalysis/Shift/Generics/RightShift002.fs
index ec1187fbd79..a3333984cb3 100644
--- a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/LexicalAnalysis/Shift/Generics/RightShift002.fs
+++ b/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/LexicalAnalysis/Shift/Generics/RightShift002.fs
@@ -9,4 +9,4 @@
type ID<'T> =
static member id (x:'T) = x
-let f x = ID> .id (* ok *)
+let f _x = ID> .id (* ok *)
diff --git a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/LexicalFiltering/HashLight/IndentationWithComputationExpression01.fs b/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/LexicalFiltering/HashLight/IndentationWithComputationExpression01.fs
index 5121084b063..c4e4117e82c 100644
--- a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/LexicalFiltering/HashLight/IndentationWithComputationExpression01.fs
+++ b/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/LexicalFiltering/HashLight/IndentationWithComputationExpression01.fs
@@ -10,7 +10,7 @@ async {
return 5
}
)
- let! b = a
- for i in 1..10000 do
+ let! _b = a
+ for _ in 1..10000 do
()
} |> Async.RunSynchronously
diff --git a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/ObjectOrientedTypeDefinitions/StructTypes/Overload_Equals.fs b/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/ObjectOrientedTypeDefinitions/StructTypes/Overload_Equals.fs
index 398f407add6..3e38632656f 100644
--- a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/ObjectOrientedTypeDefinitions/StructTypes/Overload_Equals.fs
+++ b/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/ObjectOrientedTypeDefinitions/StructTypes/Overload_Equals.fs
@@ -4,9 +4,9 @@
[]
type S3 =
- member this.Equals(s:char) = true
+ member this.Equals(_s:char) = true
//member this.Equals(s:S3) = 1.
- member this.Equals(?s:char) = true
+ member this.Equals(?_s:char) = true
#if INTERACTIVE
;;
diff --git a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/ObjectOrientedTypeDefinitions/StructTypes/Overload_GetHashCode.fs b/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/ObjectOrientedTypeDefinitions/StructTypes/Overload_GetHashCode.fs
index aca1cc87f7b..8ef04689c68 100644
--- a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/ObjectOrientedTypeDefinitions/StructTypes/Overload_GetHashCode.fs
+++ b/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/ObjectOrientedTypeDefinitions/StructTypes/Overload_GetHashCode.fs
@@ -4,9 +4,9 @@
[]
type S2 =
- member this.GetHashCode(s:char) = 1
+ member this.GetHashCode(_s:char) = 1
//member this.GetHashCode() = 1.
- member this.GetHashCode(?s:char) = 1
+ member this.GetHashCode(?_s:char) = 1
#if INTERACTIVE
;;
diff --git a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/ObjectOrientedTypeDefinitions/StructTypes/Overload_ToString.fs b/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/ObjectOrientedTypeDefinitions/StructTypes/Overload_ToString.fs
index 8a5ad46511f..af2c64e3c6c 100644
--- a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/ObjectOrientedTypeDefinitions/StructTypes/Overload_ToString.fs
+++ b/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/ObjectOrientedTypeDefinitions/StructTypes/Overload_ToString.fs
@@ -4,9 +4,9 @@
[]
type S1 =
- member this.ToString(s:char) = true
+ member this.ToString(_s:char) = true
member this.ToString() = true
- member this.ToString(?s:char) = true
+ member this.ToString(?_s:char) = true
#if INTERACTIVE
exit 0;;
diff --git a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Basic/Stats.fs b/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Basic/Stats.fs
index 8bdb04c9dc1..7158a8f5a04 100644
--- a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Basic/Stats.fs
+++ b/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/Basic/Stats.fs
@@ -18,7 +18,7 @@ let variance xs = let m = mean xs in meanMap (fun x -> sqr (x-m)) xs
let sdeviation xs = sqrt (variance xs)
let skewness xs =
- let n = float (List.length xs)
+ let _n = float (List.length xs)
let m = mean xs
let s = sdeviation xs
meanMap (fun x -> cube(x-m)) xs / (cube s)
diff --git a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/TypeChecker/GenericSubType01.fs b/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/TypeChecker/GenericSubType01.fs
index b6a3b29de86..3f7042a9d17 100644
--- a/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/TypeChecker/GenericSubType01.fs
+++ b/tests/FSharp.Compiler.ComponentTests/resources/tests/Conformance/UnitsOfMeasure/TypeChecker/GenericSubType01.fs
@@ -5,7 +5,7 @@
type SC< [] 'u>() = class end
type TC< [] 'u>() = inherit SC<'u>()
-let wff (x:SC<'u>) = ()
+let wff (_x:SC<'u>) = ()
let wgg (x:TC<'v>) = wff x // OK
diff --git a/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj b/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj
index d30dd32729c..b8b9c5df2b7 100644
--- a/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj
+++ b/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj
@@ -8,6 +8,7 @@
true
xunit
true
+ $(NoWarn);1182
diff --git a/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharpScriptTests.fs b/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharpScriptTests.fs
index 431ac983ec4..864ffbfee8d 100644
--- a/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharpScriptTests.fs
+++ b/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharpScriptTests.fs
@@ -418,7 +418,7 @@ let y = 2
foundInner <- foundInner || name = "inner")
let code = @"
let x =
- let inner = 1
+ let _inner = 1
()
"
script.Eval(code) |> ignoreValue
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 3ad6dd6550f..f7eee1e9071 100644
--- a/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj
+++ b/tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj
@@ -4,7 +4,7 @@
Exe
net472;net5.0
net5.0
- $(NoWarn);44;75;
+ $(NoWarn);44;75;1182;
true
false
true
diff --git a/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj b/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj
index dda54a28a49..81feb309b67 100644
--- a/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj
+++ b/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj
@@ -9,7 +9,7 @@
true
$(DefineConstants);ASSUME_PREVIEW_FSHARP_CORE
xunit
- $(NoWarn);57;3186;1104
+ $(NoWarn);57;3186;1104;1182;
diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj b/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj
index aa39265d2a0..0a78b26ed16 100644
--- a/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj
+++ b/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj
@@ -6,6 +6,7 @@
net5.0;net472
net5.0
Library
+ $(NoWarn);1182
FSharp.Core.UnitTests
Microsoft.FSharp.Core.UnitTests
diff --git a/tests/benchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj b/tests/benchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj
index 68b175fc21a..18f6ace7f7b 100644
--- a/tests/benchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj
+++ b/tests/benchmarks/CompilerServiceBenchmarks/FSharp.Compiler.Benchmarks.fsproj
@@ -4,6 +4,7 @@
Exe
net5.0
true
+ $(NoWarn);1182
diff --git a/tests/benchmarks/MicroPerf/MicroPerf.fsproj b/tests/benchmarks/MicroPerf/MicroPerf.fsproj
index 6e9e411e438..7fa08e87e65 100644
--- a/tests/benchmarks/MicroPerf/MicroPerf.fsproj
+++ b/tests/benchmarks/MicroPerf/MicroPerf.fsproj
@@ -11,6 +11,8 @@
$(OtherFlags) --langversion:preview
$(OtherFlags) --define:PREVIEW
+ $(NoWarn);1182
+