Skip to content

Commit 702a513

Browse files
committed
removing more dead code
1 parent b779eed commit 702a513

File tree

1 file changed

+4
-58
lines changed

1 file changed

+4
-58
lines changed

src/FsToolkit.ErrorHandling.IcedTasks/CancellableTaskResultCE.fs

Lines changed: 4 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -533,20 +533,6 @@ module CancellableTaskResultCE =
533533
[<AutoOpen>]
534534
module LowPriority =
535535
// Low priority extensions
536-
537-
// type BackgroundCancellableTaskResultBuilder with
538-
// [<NoEagerConstraintApplication>]
539-
// member inline this.Source< ^TaskLike, ^Awaiter, 'T, 'Error when ^TaskLike: (member GetAwaiter : unit -> ^Awaiter) and ^Awaiter :> ICriticalNotifyCompletion and ^Awaiter: (member get_IsCompleted :
540-
// unit -> bool) and ^Awaiter: (member GetResult : unit -> 'T)>
541-
// (t: ^TaskLike)
542-
// : CancellableTaskResult<'T, 'Error> =
543-
// fun _ ->
544-
// backgroundTask {
545-
// let! result = t
546-
// return Ok result
547-
// }
548-
549-
550536
type CancellableTaskResultBuilderBase with
551537

552538
[<NoEagerConstraintApplication>]
@@ -707,44 +693,6 @@ module CancellableTaskResultCE =
707693
//-- RESUMABLE CODE END
708694
)
709695

710-
711-
// [<NoEagerConstraintApplication>]
712-
// member inline this.Bind< ^TaskLike, 'TResult1, 'TResult2, ^Awaiter, 'TOverall when ^TaskLike: (member GetAwaiter:
713-
// unit -> ^Awaiter) and ^Awaiter :> ICriticalNotifyCompletion and ^Awaiter: (member get_IsCompleted:
714-
// unit -> bool) and ^Awaiter: (member GetResult: unit -> 'TResult1)>
715-
// (
716-
// task: ^TaskLike,
717-
// continuation: ('TResult1 -> CancellableTaskResultCode<'TOverall, 'Error, 'TResult2>)
718-
// ) : CancellableTaskResultCode<'TOveralll, 'Error, 'TResult2> =
719-
// this.Bind((fun (ct: CancellationToken) -> task), continuation)
720-
721-
// [<NoEagerConstraintApplication>]
722-
// member inline this.Bind< ^TaskLike, 'TResult1, 'TResult2, ^Awaiter, 'TOverall when ^TaskLike: (member GetAwaiter:
723-
// unit -> ^Awaiter) and ^Awaiter :> ICriticalNotifyCompletion and ^Awaiter: (member get_IsCompleted:
724-
// unit -> bool) and ^Awaiter: (member GetResult: unit -> 'TResult1)>
725-
// (
726-
// task: unit -> ^TaskLike,
727-
// continuation: ('TResult1 -> CancellableTaskResultCode<'TOveralll, 'Error, 'TResult2>)
728-
// ) : CancellableTaskResultCode<'TOveralll, 'Error, 'TResult2> =
729-
// this.Bind((fun (ct: CancellationToken) -> task ()), continuation)
730-
731-
// [<NoEagerConstraintApplication>]
732-
// member inline this.ReturnFrom< ^TaskLike, ^Awaiter, 'T when ^TaskLike: (member GetAwaiter: unit -> ^Awaiter) and ^Awaiter :> ICriticalNotifyCompletion and ^Awaiter: (member get_IsCompleted:
733-
// unit -> bool) and ^Awaiter: (member GetResult: unit -> 'T)>
734-
// (task: ^TaskLike)
735-
// : CancellableTaskResultCode<'T, 'Error 'T> =
736-
737-
// this.Bind(task, (fun v -> this.Return v))
738-
739-
740-
// [<NoEagerConstraintApplication>]
741-
// member inline this.ReturnFrom< ^TaskLike, ^Awaiter, 'T when ^TaskLike: (member GetAwaiter: unit -> ^Awaiter) and ^Awaiter :> ICriticalNotifyCompletion and ^Awaiter: (member get_IsCompleted:
742-
// unit -> bool) and ^Awaiter: (member GetResult: unit -> 'T)>
743-
// (task: unit -> ^TaskLike)
744-
// : CancellableTaskResultCode<'T, 'T> =
745-
746-
// this.Bind(task, (fun v -> this.Return v))
747-
748696
[<NoEagerConstraintApplication>]
749697
member inline this.ReturnFrom< ^TaskLike, ^Awaiter, 'T, 'Error when ^TaskLike: (member GetAwaiter :
750698
unit -> ^Awaiter) and ^Awaiter :> ICriticalNotifyCompletion and ^Awaiter: (member get_IsCompleted :
@@ -902,12 +850,10 @@ module CancellableTaskResultCE =
902850
}
903851

904852
member inline _.Source(result: CancellableTask<'T>) : CancellableTaskResult<'T, 'Error> =
905-
fun ct ->
906-
// TODO: using `cancellableTask` results in "internal error: The local field ResumptionDynamicInfo was referenced but not declare" compliation error
907-
task {
908-
let! r = result ct
909-
return Ok r
910-
}
853+
cancellableTask {
854+
let! r = result
855+
return Ok r
856+
}
911857

912858
member inline _.Source(result: ColdTask<_>) : CancellableTaskResult<_, _> =
913859
fun _ ->

0 commit comments

Comments
 (0)