Skip to content

Commit

Permalink
Add null annotation to Async.SwitchToContext (dotnet#18059)
Browse files Browse the repository at this point in the history
  • Loading branch information
BoundedChenn31 authored Nov 27, 2024
1 parent 8c0bf14 commit 95fe045
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
1 change: 1 addition & 0 deletions docs/release-notes/.FSharp.Core/9.0.200.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### Fixed

* Fix exception on Post after MailboxProcessor was disposed ([Issue #17849](https://github.com/dotnet/fsharp/issues/17849), [PR #17922](https://github.com/dotnet/fsharp/pull/17922))
* Fix missing null annotation in Async.SwitchToContext ([Issue #18055](https://github.com/dotnet/fsharp/issues/18055), [PR #18059](https://github.com/dotnet/fsharp/pull/18059))

### Added

Expand Down
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
let CreateSwitchToAsync (syncCtxt: SynchronizationContext) =
#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

0 comments on commit 95fe045

Please sign in to comment.