[GHC] #15744: Existence of complete pattern synonym hides unrelated incomplete pattern warning

GHC ghc-devs at haskell.org
Fri Oct 12 14:21:17 UTC 2018


#15744: Existence of complete pattern synonym hides unrelated incomplete pattern
warning
-------------------------------------+-------------------------------------
           Reporter:  Taneb          |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.4.3
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  Incorrect
  Unknown/Multiple                   |  error/warning at compile-time
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 This example

 {{{#!hs
 {-# LANGUAGE PatternSynonyms #-}

 pattern Foo :: a -> b -> (a, b)
 pattern Foo a b = (a, b)
 {-# complete Foo #-}

 main :: IO ()
 main = case ((), Nothing :: Maybe Integer) of
   ((), Just x) -> print x
 }}}

 doesn't give a warning for the incomplete pattern match in {{{main}}},
 which doesn't involve textually the pattern synonym {{{Foo}}}. Removing
 the complete  pragma or changing the expression being matched on to even
 {{{(,) () (Nothing :: Maybe Integer)}}} allows the warning

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


More information about the ghc-tickets mailing list