Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #18055 - Add null annotation to Async.SwitchToContext #18059

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/FSharp.Core/async.fs
Original file line number Diff line number Diff line change
Expand Up @@ -868,11 +868,7 @@ module AsyncPrimitives =

/// - Initial cancellation check
/// - Call syncCtxt.Post with exception protection. This may fail as it is arbitrary user code
#if BUILDING_WITH_LKG || NO_NULLCHECKING_LIB_SUPPORT
psfinaki marked this conversation as resolved.
Show resolved Hide resolved
let CreateSwitchToAsync (syncCtxt: SynchronizationContext) =
T-Gro marked this conversation as resolved.
Show resolved Hide resolved
#else
let CreateSwitchToAsync (syncCtxt: SynchronizationContext | null) =
#endif
MakeAsyncWithCancelCheck(fun ctxt -> ctxt.PostWithTrampoline syncCtxt ctxt.cont)

/// - Initial cancellation check
Expand Down
2 changes: 1 addition & 1 deletion src/FSharp.Core/async.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ namespace Microsoft.FSharp.Control
/// <category index="4">Threads and Contexts</category>
///
/// <example-tbd></example-tbd>
static member SwitchToContext : syncContext:System.Threading.SynchronizationContext -> Async<unit>
static member SwitchToContext : syncContext:(System.Threading.SynchronizationContext | null) -> Async<unit>

/// <summary>Creates an asynchronous computation that captures the current
/// success, exception and cancellation continuations. The callback must
Expand Down
Loading