When multiple symbols may match, we generate code like:
let x = match Parser_raw.MenhirInterpreter.incoming_symbol st with
| T T_LPAREN | T T_RPAREN -> (x : unit)
| _ -> assert false
However, or patterns don't introduce a constraint on the GADT's type variable, so this code fails to compile. Instead, we need to generate a separate arm for each case:
let x = match Parser_raw.MenhirInterpreter.incoming_symbol st with
| T T_LPAREN -> (x : unit)
| T T_RPAREN -> (x : unit)
| _ -> assert false
When multiple symbols may match, we generate code like:
However, or patterns don't introduce a constraint on the GADT's type variable, so this code fails to compile. Instead, we need to generate a separate arm for each case: