Skip to content

Commit 22e60a4

Browse files
committed
Adapt for release
1 parent 878a7b3 commit 22e60a4

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

src/FSharpPlus/Extensions/Task.fs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,11 @@ module Task =
367367

368368
/// <summary>Creates a task workflow from 'source' workflow, mapping and flattening its result with 'f'.</summary>
369369
let bind (f: 'T -> Task<'U>) (source: Task<'T>) : Task<'U> =
370+
#if !NET45
370371
let source = nullArgCheck (nameof source) source
372+
#else
373+
raiseIfNull "source" source
374+
#endif
371375

372376
source |> Unchecked.nonNull |> map f |> join
373377

@@ -479,17 +483,25 @@ module Task =
479483
/// <param name="source">The source task.</param>
480484
/// <returns>A successful resulting task.</returns>
481485
/// <remarks>The result is always a successful task, unless the mapping function itself throws an exception.</remarks>
482-
let inline recover ([<InlineIfLambda>]mapper: exn -> 'T) (source: Task<'T>) : Task<'T> =
486+
let inline recover (mapper: exn -> 'T) (source: Task<'T>) : Task<'T> =
487+
#if !NET45
483488
let source = nullArgCheck (nameof source) source
489+
#else
490+
raiseIfNull "source" source
491+
#endif
484492

485493
tryWith (fun () -> source) (mapper >> result)
486494

487495
/// <summary>Maps the exception of a faulted task to another exception.</summary>
488496
/// <param name="mapper">Mapping function from exception to exception.</param>
489497
/// <param name="source">The source task.</param>
490498
/// <returns>The resulting task.</returns>
491-
let inline mapError ([<InlineIfLambda>]mapper: exn -> exn) (source: Task<'T>) : Task<'T> =
499+
let mapError (mapper: exn -> exn) (source: Task<'T>) : Task<'T> =
500+
#if !NET45
492501
let source = nullArgCheck (nameof source) source
502+
#else
503+
raiseIfNull "source" source
504+
#endif
493505

494506
if source.IsCompleted then
495507
match source with

0 commit comments

Comments
 (0)