In OCaml 4.07, you can’t use GADTs in or-patterns.
In OCaml 4.08 you can use GADTs in some or-patterns, but you can’t make use of type equations introduced by or-patterns (in your case, the equation a = int
), so unfortunately your specific example still won’t compile.