-
Notifications
You must be signed in to change notification settings - Fork 65
Closed
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
Is your feature request related to a problem? Please describe.
Using the option CE with <Nullable>enable</Nullable> in the .fsproj, some let! declarations need type annotations to compile.
An example is in the repo https://github.com/marklam/Nullness, but the crux of it is:
module Program
open FsToolkit.ErrorHandling
type [<Measure>] m
type [<Measure>] r
type P = | P
type S = | S
let y (s : S option ) (p : P option)=
option {
// Needs annotation
//let! (_s : S) = s
let! _s = s
// Needs annotation
//let! (_p : P) = p
let! _p = p
()
} |> ignore
[<EntryPoint>]
let main argv =
0Describe the solution you'd like
The option CE to work without hints to the type inference.
Describe alternatives you've considered
Adding type hints.
(I also tried rebuilding FsToolkit.ErrorHandling with <Nullable>enable</Nullable> but I didn't know enough about the implementation of Option.bind etc to achieve anything.)
Additional context
This was originally raised as an issue with F#9's nullability changes dotnet/fsharp#17776
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers