[GHC] #10746: No non-exhaustive pattern match warning given for empty case analysis

GHC ghc-devs at haskell.org
Mon Apr 11 14:52:10 UTC 2016


#10746: No non-exhaustive pattern match warning given for empty case analysis
-------------------------------------+-------------------------------------
        Reporter:  bgamari           |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.10.2
      Resolution:                    |             Keywords:
                                     |  PatternMatchWarnings
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Incorrect         |  Unknown/Multiple
  warning at compile-time            |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #7669, #11806     |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by dfeuer):

 I don't think you need to go that far to satisfy many people, although
 maybe I'm missing something. We mostly want you to inspect all
 constructors of the relevant datatype that have not obviously been
 eliminated previously and check that their result types are apart from the
 type of the scrutinee. The reason for the perhaps-counterintuitive design
 choice is that a ''lazy'' empty `case` would be quite useless--you'd
 always be better off with an `error` call than such a beast! Strict empty
 case, on the other hand, will be quite useful once this bug is squashed.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10746#comment:20>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list