summaryrefslogtreecommitdiff
path: root/testsuite/tests/pmcheck/complete_sigs/T14059b.hs
blob: 52f3593ecdc01cda81239ffd6366091e2bea7186 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -Wincomplete-patterns #-}
module Bug where

data family Sing (a :: k)

data instance Sing (z :: Bool) where
  SFalse :: Sing False
  STrue  :: Sing True

pattern STooGoodToBeTrue :: forall (z :: Bool). ()
                         => z ~ True
                         => Sing z
pattern STooGoodToBeTrue = STrue
{-# COMPLETE SFalse, STooGoodToBeTrue #-}

wibble :: Sing (z :: Bool) -> Bool
wibble STrue = True

wobble :: Sing (z :: Bool) -> Bool
wobble STooGoodToBeTrue = True