summaryrefslogtreecommitdiff
path: root/testsuite/tests/pmcheck/complete_sigs/T18960b.hs
blob: 0cccc8aff1775de295f20c6729e17b80c707dcfb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{-# OPTIONS_GHC -Wincomplete-patterns -fforce-recomp #-}
{-# LANGUAGE PatternSynonyms #-}

module T18960b where

pattern P :: a -> a
pattern P x = x
{-# COMPLETE P :: () #-}

bar :: ()
bar = case undefined of
    P ((), "hello") -> ()
    -- prints too many of apparently the same missing patterns,
    -- because we prefer to report positive info (@((), [])@) rather than
    -- negative info (@P ((), x:_) where x is not one of {'h'}@)

baz :: ()
baz = case undefined of
    P ((), "hello") -> ()
    -- This function is proof that we in theory can provide a "better" warning.