amuletml / amulet

An ML-like functional programming language
https://amulet.works/
BSD 3-Clause "New" or "Revised" License
324 stars 14 forks source link

Crash with "Cannot get type name" in incomplete pattern matches #292

Closed viluon closed 3 years ago

viluon commented 3 years ago

amc crashes when trying to compile an "unsaturated" pattern match, such as the one below.

type t = T of ()
let _ = fun (T) -> ()
$ amc compile src/mre.ml
amc: Cannot get type name from unit -> t#1
CallStack (from HasCallStack):
  error, called at src/Syntax/Verify/Pattern.hs:425:15 in amuletml-1.0.0.0-A8dKuWQRIKuANEmZJNYfpR:Syntax.Verify.Pattern