Skip to content

Commit bfd636a

Browse files
gustywallymathieu
authored andcommitted
Cleanup warning noise (#630)
1 parent 7b104d9 commit bfd636a

13 files changed

Lines changed: 23 additions & 5 deletions

File tree

docsrc/content/applicative-functors.fsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ A List functor can be thought of as a function which takes an integer index to r
7878
So, you can think of ``map`` on a List functor as composing a function:
7979
8080
**)
81+
82+
#nowarn "0025" // Incomplete pattern matches on this expression. For example, the value '3' may indicate a case not covered by the pattern(s)
83+
8184
let listFunc = function 0 -> 1 | 1 -> 2 | 2 -> 3 // [1;2;3]
8285
let r01'' = map (fun x -> string (x + 10)) listFunc
8386

docsrc/content/type-free.fsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// This block of code is omitted in the generated HTML documentation. Use
33
// it to define helpers that you do not want to show in the documentation.
44
#r @"../../src/FSharpPlus/bin/Release/netstandard2.0/FSharpPlus.dll"
5+
#nowarn "0040" // This and other recursive references to the object(s) being defined will be checked for initialization-soundness at runtime through the use of a delayed reference.
6+
// This is because you are defining one or more recursive objects, rather than recursive functions.
7+
58
(**
69
Free<'Functor<'T>, 'T>
710
======================
@@ -89,7 +92,7 @@ type Reservation = {
8992
Name : string
9093
Email : string
9194
Quantity : int }
92-
with static member Create (Quantity, Date, Name, Email) = { Date = Date; Name = Name; Email = Email; Quantity = Quantity }
95+
with static member Create (quantity, date, name, email) = { Date = date; Name = name; Email = email; Quantity = quantity }
9396

9497
let readReservationRequest =
9598
curryN Reservation.Create

docsrc/content/type-seqt.fsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// it to define helpers that you do not want to show in the documentation.
44

55
#r @"../../src/FSharpPlus/bin/Release/netstandard2.0/FSharpPlus.dll"
6+
#nowarn "0044" // Suppress warning FS0044: This construct is deprecated. WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.
67

78
// For some reason AsyncDownloadString is not found during doc build. The following is a dumb implementation just to make the compiler happy.
89
// TODO find out why.

src/FSharpPlus.Docs/Samples/Learn You a Haskell.fsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,8 @@ let addStuff4 = // 19
322322
State monad
323323
--------------------------------------------------*)
324324

325+
#nowarn "0025" // Incomplete pattern matches on this expression. For example, the value '[]' may indicate a case not covered by the pattern(s)
326+
325327
type Stack = List<int>
326328

327329
let pop (x::xs) = (x,xs)

src/FSharpPlus.TypeLevel/FSharpPlus.TypeLevel.fsproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<Platforms>AnyCPU</Platforms>
88
<LangVersion Condition=" '$(Configuration)' == 'Fable'">5.0</LangVersion>
99
<DefineConstants Condition=" '$(Configuration)' == 'Fable'">$(DefineConstants);FABLE_COMPILER</DefineConstants>
10+
<OtherFlags>--nowarn:0044 $(OtherFlags)</OtherFlags>
1011
</PropertyGroup>
1112

1213
<ItemGroup>

src/FSharpPlus.TypeLevel/Providers/FSharpPlus.Providers.fsproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1414
<OtherFlags Condition=" '$(TargetFramework)' == 'netstandard2.0'">--warnon:1182 $(OtherFlags)</OtherFlags>
1515
<OtherFlags Condition=" '$(TargetFramework)' == 'net46'">--warnon:1182 $(OtherFlags)</OtherFlags>
16+
<OtherFlags>--nowarn:0044 --warnon:1182 $(OtherFlags)</OtherFlags>
1617
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
1718
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
1819
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>

src/FSharpPlus/Control/Monad.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,15 @@ type Join =
136136
match v.TryGetValue (k) with
137137
| true, v -> dct.Add (k, v)
138138
| _ -> ()
139-
dct :> IDictionary<'Key, 'U>
139+
dct :> IDictionary<'Key, 'Value>
140140

141141
static member Join (x: IReadOnlyDictionary<_, IReadOnlyDictionary<_, _>>, [<Optional>]_output: IReadOnlyDictionary<'Key, 'Value>, [<Optional>]_mthd: Join) : IReadOnlyDictionary<'Key, 'Value> =
142142
let dct = Dictionary ()
143143
for KeyValue(k, v) in x do
144144
match v.TryGetValue (k) with
145145
| true, v -> dct.Add (k, v)
146146
| _ -> ()
147-
dct :> IReadOnlyDictionary<'Key, 'U>
147+
dct :> IReadOnlyDictionary<'Key, 'Value>
148148

149149
static member Join (x: ResizeArray<ResizeArray<'T>> , [<Optional>]_output: ResizeArray<'T> , [<Optional>]_mthd: Join) = ResizeArray (Seq.bind seq<_> x) : ResizeArray<'T>
150150

src/FSharpPlus/Data/NonEmptyList.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ module NonEmptyList =
178178
/// <summary>Splits the list in head and tail.</summary>
179179
/// <param name="list">The input list.</param>
180180
/// <returns>A tuple with the head and the tail of the original list.</returns>
181-
let unconsAsList ({ Head = x; Tail = xs } as list) = x, xs
181+
let unconsAsList { Head = x; Tail = xs } = x, xs
182182

183183
/// Returns the first element of a new non empty list. You can also use property nel.Head.
184184
let head {Head = x; Tail = _ } = x

tests/CSharpLib/CustomerId.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ public struct CustomerId : IEquatable<CustomerId>
1010
public long Value { get; }
1111
public CustomerId(long value) => this.Value = value;
1212
public static readonly CustomerId Empty = new CustomerId();
13+
#pragma warning disable CA2013 // Do not use ReferenceEquals with value types
1314
public bool Equals(CustomerId other) => !ReferenceEquals(null, other) && Equals(Value, other.Value);
15+
#pragma warning restore CA2013 // Do not use ReferenceEquals with value types
1416
public override bool Equals(object obj) => obj is CustomerId id && Equals(id);
1517
public override int GetHashCode() => Value.GetHashCode();
1618
public override string ToString() => Value.ToString();

tests/FSharpPlusFable.Tests/FSharpPlusFable.Tests.fsproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<DefineConstants Condition=" '$(Configuration)' == 'Fable3'">$(DefineConstants);FABLE_COMPILER;FABLE_COMPILER_3;FABLE_COMPILER_FAKE</DefineConstants>
1010
<DefineConstants Condition=" '$(Configuration)' == 'Fable4'">$(DefineConstants);FABLE_COMPILER;FABLE_COMPILER_4;FABLE_COMPILER_FAKE</DefineConstants>
1111
<TargetFramework>net6.0</TargetFramework>
12+
<OtherFlags>--nowarn:3520 $(OtherFlags)</OtherFlags>
1213
</PropertyGroup>
1314

1415
<ItemGroup>

0 commit comments

Comments
 (0)