Opened 11 months ago

Last modified 11 months ago

#15744 new bug

Existence of complete pattern synonym hides unrelated incomplete pattern warning

Reported by: Taneb Owned by:
Priority: normal Milestone:
Component: Compiler Version: 8.4.3
Keywords: PatternMatchWarnings, PatternSynonyms Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Incorrect error/warning at compile-time Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


This example

{-# 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

Change History (1)

comment:1 Changed 11 months ago by RyanGlScott

Keywords: PatternMatchWarnings PatternSynonyms added
Note: See TracTickets for help on using tickets.