let f e = match e with | `A -> "a" let g e = match e with | `B -> "b" | _ as e -> f e
I get an error:
Error: This expression has type [> `B ] but an expression was expected of type [< `A ] The second variant type does not allow tag(s) `B
but this compiles fine
let g e = match e with | `B -> "b" | `A as e -> f e
Is there any way to tell the compiler to deduce the type of
_ in the first fragment?