summaryrefslogtreecommitdiff
path: root/testsuite/tests/patsyn/should_fail/T14507.hs
blob: 9599b73c77804a41ed1b4451feb1f926baab4d04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{-# Language PatternSynonyms, ViewPatterns, GADTs, ConstraintKinds, RankNTypes,
             PolyKinds, ScopedTypeVariables, DataKinds, TypeOperators,
             TypeApplications, TypeFamilies, TypeFamilyDependencies #-}

module T14507 where

import Type.Reflection
import Data.Kind

foo :: TypeRep a -> (Bool :~~: k, TypeRep a)
foo rep = error "urk"

type family SING :: k -> Type where
  SING = (TypeRep :: Bool -> Type)

pattern RepN :: forall kk (a::kk). () => Bool~kk => SING a -> TypeRep (a::kk)
pattern RepN tr <- (foo -> ( HRefl :: Bool:~~:kk
                           , tr :: TypeRep (a::Bool)))

pattern SO x <- RepN (id -> x)