Skip to content

Commit b4b145d

Browse files
committed
Remove not null constraint, define nullArgCheck and Unchecked.nonNull
1 parent a3e7ffa commit b4b145d

File tree

14 files changed

+22
-3
lines changed

14 files changed

+22
-3
lines changed

src/FSharpPlus/Extensions/Array.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module Array =
88

99
open System
1010
open FSharp.Core.CompilerServices
11+
open FSharpPlus.Internals.Errors
1112

1213
/// <summary>Adds an element to the beginning of the given array</summary>
1314
/// <param name="value">The element to add</param>

src/FSharpPlus/Extensions/Dict.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module Dict =
1515

1616
/// <summary>Creates an empty dictionary.</summary>
1717
[<GeneralizableValue>]
18-
let empty<'Key, 'U when 'Key : equality and 'Key : not null> = printfn "creating"; Dictionary<'Key, 'U> () :> IDictionary<_,_>
18+
let empty<'Key, 'U when 'Key : equality> = printfn "creating"; Dictionary<'Key, 'U> () :> IDictionary<_,_>
1919

2020
/// <summary>Tries to get the value of the given key.</summary>
2121
/// <remarks>This is a function wrapper for the IDictionary.TryGetValue method,

src/FSharpPlus/Extensions/Dictionary.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module Dictionary =
1616

1717
/// <summary>Creates an empty dictionary.</summary>
1818
[<GeneralizableValue>]
19-
let empty<'Key, 'U when 'Key : equality and 'Key : not null> = Dictionary<'Key, 'U> ()
19+
let empty<'Key, 'U when 'Key : equality> = Dictionary<'Key, 'U> ()
2020

2121
/// <summary>Tries to get the value of the given key.</summary>
2222
/// <remarks>Note: this is a function wrapper for the Dictionary.TryGetValue method,

src/FSharpPlus/Extensions/Exception.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
module Exception =
66
open System
77
open System.Runtime.ExceptionServices
8+
open FSharpPlus.Internals.Errors
89

910
#if !FABLE_COMPILER
1011

src/FSharpPlus/Extensions/Extensions.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ namespace FSharpPlus
44
module Extensions =
55

66
open System
7+
open FSharpPlus.Internals.Errors
78

89
type Collections.Generic.IEnumerable<'T> with
910
member this.GetSlice = function

src/FSharpPlus/Extensions/HashSet.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[<RequireQualifiedAccess>]
55
module HashSet =
66
open System.Collections.Generic
7+
open FSharpPlus.Internals.Errors
78

89
/// <summary>The empty set for the type 'T.</summary>
910
[<GeneralizableValue>]

src/FSharpPlus/Extensions/IReadOnlyDictionary.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module IReadOnlyDictionary =
1212

1313
/// <summary>Creates an empty read-only dictionary.</summary>
1414
[<GeneralizableValue>]
15-
let empty<'Key, 'U when 'Key : equality and 'Key : not null> = Dictionary<'Key, 'U> () :> IReadOnlyDictionary<_,_>
15+
let empty<'Key, 'U when 'Key : equality> = Dictionary<'Key, 'U> () :> IReadOnlyDictionary<_,_>
1616

1717
/// Replaces or sets the item associated with a specified key with the specified value.
1818
let add key value (source: IReadOnlyDictionary<'Key, 'Value>) = source |> Seq.map (|KeyValue|) |> Map |> Map.add key value :> IReadOnlyDictionary<_,_>

src/FSharpPlus/Extensions/List.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module List =
88

99
open System
1010
open FSharp.Core.CompilerServices
11+
open FSharpPlus.Internals.Errors
1112

1213
/// <summary>Returns a list that contains one item only.</summary>
1314
///

src/FSharpPlus/Extensions/ResizeArray.fs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
[<RequireQualifiedAccess>]
55
module ResizeArray =
66

7+
open FSharpPlus.Internals.Errors
8+
79
/// <summary>Builds a new ResizeArray whose elements are the results of applying the given function
810
/// to each of the elements of the ResizeArray.</summary>
911
///

src/FSharpPlus/Extensions/Seq.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ namespace FSharpPlus
44
[<RequireQualifiedAccess>]
55
module Seq =
66
open System
7+
open FSharpPlus.Internals.Errors
78

89
/// <summary>Adds an element to the beginning of the given sequence</summary>
910
/// <param name="value">The element to add</param>

0 commit comments

Comments
 (0)