[GHC] #14773: MultiWayIf makes it easy to write partial programs that are not catched by -Wall
GHC
ghc-devs at haskell.org
Thu Feb 8 03:07:37 UTC 2018
#14773: MultiWayIf makes it easy to write partial programs that are not catched by
-Wall
-------------------------------------+-------------------------------------
Reporter: SimonHengel | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.2.2
Resolution: | Keywords:
| PatternMatchWarnings
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by RyanGlScott):
Sigh. I don't see an easy way to fix this. The issue is that the entry-
point into the pattern match coverage checker, `checkMatches`, requires a
list of `LPat`s as its arguments. However, the AST for multi-way-`if`
(`HsMultiIf`) has `GRHS`es, not `LPat`s. That's the same reason why this
program doesn't emit any warnings under `-Wall`:
{{{#!hs
b :: Bool
Just b | False = Nothing
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14773#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list