Skip to content

Bug: Compiler crashes when pattern is not fully matched

Repro: https://ide.ligolang.org/p/dyUf6Kjh3RZZYhvtwu_FRg

type storage = int

type parameter =
  Increment of (int * int * int)
| Reset

type return = operation list * storage

let main (action, store : parameter * storage) : return =
 ([] : operation list),
 (match action with
   Increment (n, m) -> 0
 | Reset            -> 0)

the Increment constructor holds data of a type triple (int * int * int) in a pattern match case if Increment is not fully matched e.g. Increment (n, m) The compiler crashes with exception

Error: Fatal error: exception (Failure Not_found)
Raised at file "stdlib.ml", line 29, characters 17-33
Called from file "src/bin/cli.ml", line 753, characters 5-124
Called from file "src/bin/runligo.ml", line 3, characters 15-31