Wildcard pattern overriding subtype constraint on polymorphic variant
Given these types type a = [ `A ] type b = [ a | `B | `C ] and this function let pp: [< b] -> string = function | `A -> "A" | `B -> "B" | `C -> "C" applying a value of type a works without issue, as expected: let a: a = `A let _ = pp a However, if the function is modified to include a wildcard pattern let pp: [< b] -> string = function | `A -> "A" | `B -> "B" | _ -> "?" even though everything else remains the same, it now yields the following error (on let _ = pp a ): This expression has type b -> string but an expression was expected of type a -> 'a Type b = [ `A | `B ] is not compatible with