Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-exhaustive pattern exception when parsing MultiWayIf with parse(Module)WithMode #94

Closed
bergmark opened this issue Apr 14, 2014 · 5 comments

Comments

@bergmark
Copy link
Member

This is using haskell-src-exts 1.15.0 and doesn't seem to be reproducible when using parseFileWithMode.

Reproduction:

λ> import Language.Haskell.Exts.Annotated
λ> fmap (fmap (const ())) (parseModuleWithMode defaultParseMode { extensions = [EnableExtension MultiWayIf] } "f = if | True -> ()")

ParseOk (Module () Nothing [] [] [PatBind () (PVar () (Ident () "f")) Nothing (UnGuardedRhs ()
*** Exception: src/Language/Haskell/Exts/Annotated/Syntax.hs:(1135,16)-(1186,55): Non-exhaustive patterns in case
@UnkindPartition
Copy link
Member

D'oh! Turns out we don't have -Wall enabled. Will fix shortly.

@UnkindPartition
Copy link
Member

These particular errors should now be fixed in HEAD.

However, running with warnings enabled revealed some other incomplete patterns. I'll try to fix them during the next couple of days and make a bugfix release then.

Still, the problems may only arise when using the new extensions. Code that worked previously should continue working. So I don't think there's a reason not to upgrade.

@UnkindPartition
Copy link
Member

And thanks for the report :)

@UnkindPartition
Copy link
Member

I've fixed all inexhaustive patterns. Now we build with -fwarn-incomplete-patterns by default.

Released as 1.15.0.1.

@bergmark
Copy link
Member Author

It works, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants