Skip to content

Commit 95fe045

Browse files
Add null annotation to Async.SwitchToContext (#18059)
1 parent 8c0bf14 commit 95fe045

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

docs/release-notes/.FSharp.Core/9.0.200.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
### Fixed
22

33
* 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))
4+
* 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))
45

56
### Added
67

src/FSharp.Core/async.fs

-4
Original file line numberDiff line numberDiff line change
@@ -868,11 +868,7 @@ module AsyncPrimitives =
868868

869869
/// - Initial cancellation check
870870
/// - Call syncCtxt.Post with exception protection. This may fail as it is arbitrary user code
871-
#if BUILDING_WITH_LKG || NO_NULLCHECKING_LIB_SUPPORT
872871
let CreateSwitchToAsync (syncCtxt: SynchronizationContext) =
873-
#else
874-
let CreateSwitchToAsync (syncCtxt: SynchronizationContext | null) =
875-
#endif
876872
MakeAsyncWithCancelCheck(fun ctxt -> ctxt.PostWithTrampoline syncCtxt ctxt.cont)
877873

878874
/// - Initial cancellation check

src/FSharp.Core/async.fsi

+1-1
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ namespace Microsoft.FSharp.Control
647647
/// <category index="4">Threads and Contexts</category>
648648
///
649649
/// <example-tbd></example-tbd>
650-
static member SwitchToContext : syncContext:System.Threading.SynchronizationContext -> Async<unit>
650+
static member SwitchToContext : syncContext:(System.Threading.SynchronizationContext | null) -> Async<unit>
651651

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

0 commit comments

Comments
 (0)