diprism / perpl

The PERPL Compiler
MIT License
10 stars 5 forks source link

Out-of-scope datatype args cause crash #132

Closed colin-mcd closed 1 year ago

colin-mcd commented 1 year ago

Currently, datatype constructor args that are out-of-scope cause the compiler to crash:

data Test a = Ctor1 a | Ctor2 Undefined;
Ctor1 ()

I believe this happens when computing SCCs. I'm working on a fix and will hopefully push soon.

colin-mcd commented 1 year ago
$ ./perplc -z tests/bad/unbound_type_var.ppl 
perplc: Map.!: given key is not an element in the map
CallStack (from HasCallStack):
  error, called at libraries/containers/Data/Map/Internal.hs:610:17 in containers-0.6.0.1:Data.Map.Internal