@@ -545,7 +545,7 @@ module CancellableTaskValidationCE =
545545
546546 type CancellableTaskValidationBuilderBase with
547547
548-
548+ // https://github.com/dotnet/fsharp/discussions/15567
549549 [<NoEagerConstraintApplication>]
550550 member inline this.MergeSources < 'TResult1 , 'TResult2 , ^Awaiter1 , ^Awaiter2 , 'Error
551551 when ^Awaiter1 :> ICriticalNotifyCompletion
@@ -574,13 +574,9 @@ module CancellableTaskValidationCE =
574574 ( handler ct) .GetAwaiter()
575575 )
576576
577-
578577 [<NoEagerConstraintApplication>]
579- member inline this.Source < 'Awaitable , ^Awaiter , 'T , 'Error
580- when 'Awaitable : ( member GetAwaiter : unit -> ^Awaiter )
581- and ^Awaiter :> ICriticalNotifyCompletion
582- and ^Awaiter : ( member get_IsCompleted : unit -> bool )
583- and ^Awaiter : ( member GetResult : unit -> 'T )>
578+ member inline this.Source < 'Awaitable , 'Awaiter , 'TResult
579+ when Awaitable < 'Awaitable , 'Awaiter , 'TResult >>
584580 ( [<InlineIfLambda>] t : CancellationToken -> 'Awaitable )
585581 =
586582
@@ -593,11 +589,8 @@ module CancellableTaskValidationCE =
593589
594590
595591 [<NoEagerConstraintApplication>]
596- member inline this.Source < 'Awaitable , ^Awaiter , 'T , 'Error
597- when 'Awaitable : ( member GetAwaiter : unit -> ^Awaiter )
598- and ^Awaiter :> ICriticalNotifyCompletion
599- and ^Awaiter : ( member get_IsCompleted : unit -> bool )
600- and ^Awaiter : ( member GetResult : unit -> 'T )>
592+ member inline this.Source < 'Awaitable , 'Awaiter , 'TResult
593+ when Awaitable < 'Awaitable , 'Awaiter , 'TResult >>
601594 ( [<InlineIfLambda>] t : unit -> 'Awaitable )
602595 =
603596
@@ -610,11 +603,8 @@ module CancellableTaskValidationCE =
610603
611604
612605 [<NoEagerConstraintApplication>]
613- member inline this.Source < 'Awaitable , ^Awaiter , 'T , 'Error
614- when 'Awaitable : ( member GetAwaiter : unit -> ^Awaiter )
615- and ^Awaiter :> ICriticalNotifyCompletion
616- and ^Awaiter : ( member get_IsCompleted : unit -> bool )
617- and ^Awaiter : ( member GetResult : unit -> 'T )>
606+ member inline this.Source < 'Awaitable , 'Awaiter , 'TResult
607+ when Awaitable < 'Awaitable , 'Awaiter , 'TResult >>
618608 ( t : 'Awaitable )
619609 =
620610
@@ -632,14 +622,7 @@ module CancellableTaskValidationCE =
632622
633623
634624 [<NoEagerConstraintApplication>]
635- member inline this.Source < 'Awaitable , ^Awaiter , 'T , 'Error
636- when 'Awaitable : ( member GetAwaiter : unit -> ^Awaiter )
637- and ^Awaiter :> ICriticalNotifyCompletion
638- and ^Awaiter : ( member get_IsCompleted : unit -> bool )
639- and ^Awaiter : ( member GetResult : unit -> Result<'T , 'Error > )>
640- ( [<InlineIfLambda>] t : CancellationToken -> 'Awaitable )
641- =
642-
625+ member inline this.Source ( [<InlineIfLambda>] t : CancellationToken -> 'Awaitable ) =
643626 fun ct ->
644627 ( task {
645628 let! r = t ct
@@ -649,14 +632,7 @@ module CancellableTaskValidationCE =
649632
650633
651634 [<NoEagerConstraintApplication>]
652- member inline this.Source < 'Awaitable , ^Awaiter , 'T , 'Error
653- when 'Awaitable : ( member GetAwaiter : unit -> ^Awaiter )
654- and ^Awaiter :> ICriticalNotifyCompletion
655- and ^Awaiter : ( member get_IsCompleted : unit -> bool )
656- and ^Awaiter : ( member GetResult : unit -> Result<'T , 'Error > )>
657- ( [<InlineIfLambda>] t : unit -> 'Awaitable )
658- =
659-
635+ member inline this.Source ( [<InlineIfLambda>] t : unit -> 'Awaitable ) =
660636 fun ( ct : CancellationToken ) ->
661637 ( task {
662638 let! r = t ()
@@ -666,14 +642,7 @@ module CancellableTaskValidationCE =
666642
667643
668644 [<NoEagerConstraintApplication>]
669- member inline this.Source < 'Awaitable , ^Awaiter , 'T , 'Error
670- when 'Awaitable : ( member GetAwaiter : unit -> ^Awaiter )
671- and ^Awaiter :> ICriticalNotifyCompletion
672- and ^Awaiter : ( member get_IsCompleted : unit -> bool )
673- and ^Awaiter : ( member GetResult : unit -> Result<'T , 'Error > )>
674- ( t : 'Awaitable )
675- =
676-
645+ member inline this.Source ( t : 'Awaitable ) =
677646 fun ( ct : CancellationToken ) ->
678647 ( task {
679648 let! r = t
@@ -724,7 +693,6 @@ module CancellableTaskValidationCE =
724693 // Low priority extensions
725694 type CancellableTaskValidationBuilderBase with
726695
727-
728696 member inline this.Source ( t : Task < 'T >) =
729697 fun ( ct : CancellationToken ) -> ( Task.map Validation.ok t) .GetAwaiter()
730698
0 commit comments