[GHC] #3927: Incomplete/overlapped pattern warnings + GADTs = inadequate

GHC ghc-devs at haskell.org
Thu Apr 17 02:45:35 UTC 2014


#3927: Incomplete/overlapped pattern warnings + GADTs = inadequate
-------------------------------------+------------------------------------
        Reporter:  simonpj           |            Owner:  simonpj
            Type:  bug               |           Status:  new
        Priority:  high              |        Milestone:  7.8.3
       Component:  Compiler          |          Version:  6.12.1
      Resolution:                    |         Keywords:
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:  #4139
-------------------------------------+------------------------------------

Comment (by cactus):

 I was asked about the following program failing to compile. Do you think
 this is also caused by the same underlying problem?


 {{{
 {-# OPTIONS_GHC -fwarn-incomplete-patterns -Werror #-}
 {-# LANGUAGE GADTs, TypeFamilies #-}

 type family F a
 type instance F a = ()

 data Foo a where
     FooA :: Foo ()
     FooB :: Foo Int

 f :: a -> Foo (F a) -> ()
 f _ FooA = ()

 }}}

 The error/warning is, of course:

 {{{
 gadt-incomplete.hs:12:1: Warning:
     Pattern match(es) are non-exhaustive
     In an equation for `f': Patterns not matched: _ FooB

 }}}

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


More information about the ghc-tickets mailing list