[GHC] #15753: Inconsistent pattern-match warnings when using guards versus case expressions

GHC ghc-devs at haskell.org
Sat Jan 5 06:23:03 UTC 2019


#15753: Inconsistent pattern-match warnings when using guards versus case
expressions
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.10.1
       Component:  Compiler          |              Version:  8.6.1
      Resolution:                    |             Keywords:
                                     |  PatternMatchWarnings
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Incorrect         |  Unknown/Multiple
  error/warning at compile-time      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #15884, #16129    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by sjakobi):

 Another (tiny) reduction:

 {{{#!hs
 {-# LANGUAGE PatternSynonyms #-}
 module Bug where

 {-# COMPLETE Id #-}
 pattern Id :: ()
 pattern Id = ()

 bug :: ()
 bug | Id <- id () = ()
 }}}

 {{{
 Bug.hs:9:1: warning: [-Wincomplete-patterns]
     Pattern match(es) are non-exhaustive
     In an equation for ‘bug’: Guards do not cover entire pattern space
   |
 9 | bug | Id <- id () = ()
   | ^^^^^^^^^^^^^^^^^^^^^^
 }}}

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


More information about the ghc-tickets mailing list