Skip to content

Pattern matching simplification failure

Given the minimal example:

type action = ["A"]  | ["B"]  | ["C"];
type state  = ["S1"] | ["S2"]

let do_something = ([state, action]:[state,action]) : state => {
    return match(state, {
        S1: () => (match(action, {
            A: () => S1(),
            B: () => S2(),
        })),
        S2: () => (match(action, {
            A: () => S2(),
            B: () => S1(),
        })),        
    });
};

The compilation crashes with the following message:

Internal error: File "src/passes/11-self_ast_typed/pattern_matching_simpl.ml", line 104, characters 52-59 

Compiler version:

2022-05-03T18:50:38+00:00
9faa2515601bbb03a1122531083562e4c8b45d12
Commit
Commit
Date:
Rolling
SHA:
release
Edited by Didier Plaindoux