
#11806: GHC does not warn for mistakenly empty case -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC accepts | Unknown/Multiple invalid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * cc: gkaracha (added) Comment: Yes that is odd. If you have {{{ module T11806 where f1 :: Int -> Int f1 x = case x of { 1 -> 2 } f2 :: Bool -> Int f2 x = case x of { True -> 2 } }}} you get (with 8.0) {{{ T11806.hs:7:8: warning: [-Wincomplete-patterns] Pattern match(es) are non-exhaustive In a case alternative: Patterns not matched: p where p is not one of {1} T11806.hs:10:8: warning: [-Wincomplete-patterns] Pattern match(es) are non-exhaustive In a case alternative: Patterns not matched: False }}} but if you remove all the branches, you get no warnings at all! I'm adding George (who is responsible for pattern match overlap checks) in cc. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11806#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler