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

module T19475 where

class C f where
  foo :: f a -> ()
pattern P :: C f => f a
pattern P <- (foo -> ())
{-# COMPLETE P #-}

class D f where
  bar :: f a -> ()
pattern Q :: D f => f a
pattern Q <- (bar -> ())

g :: D f => f a -> ()
g Q = () -- Warning should not suggest P!