Does F# narrow types if they've been narrowed in a previous guard?
type FirstOption = bool option
type SecondOption = bool option
let foo first second =
match first with
| None -> false
| Some value when second.IsSome ->
// second is still Option<bool>
sencond // x this doesn't fly.
| Some value -> false
I've been using Optopn.map/map2/map3 in these cases but was wondering if maybe i've done something wrong.
In the case of TypeScript they have Control Flow Based Analysis : https://github.com/microsoft/TypeScript/issues/2388