faylang / fay

A proper subset of Haskell that compiles to JavaScript
https://github.com/faylang/fay/wiki
BSD 3-Clause "New" or "Revised" License
1.28k stars 89 forks source link

Fix panic when compiling irrefutable pattern matches on lists (issue #434) #438

Closed cdparks closed 9 years ago

cdparks commented 9 years ago

Fixes #434. Before, attempting to pattern match on a list using a let-binding would crash the compiler and spit out the pattern AST. This was happening because compilePatBind' assumed the pattern would be compiled to a single JsStmt. This does not hold for list patterns.

Additionally, compilePatBind' was not generating code to throw an error if a nested irrefutable pattern match failed.