Fix lexically-scoped type variables
[ghc.git] / testsuite / tests / typecheck / should_compile / T13881.hs
1 {-# LANGUAGE DataKinds #-}
2 {-# LANGUAGE GADTs #-}
3 {-# LANGUAGE PolyKinds #-}
4 {-# LANGUAGE ScopedTypeVariables #-}
5 {-# LANGUAGE TypeFamilies #-}
6 {-# LANGUAGE TypeOperators #-}
7 module T13881 where
8
9 data family Sing (a :: k)
10
11 data instance Sing (z :: [a]) where
12 SNil :: Sing '[]
13 SCons :: Sing x -> Sing xs -> Sing (x ': xs)
14
15 fl :: forall (l :: [a]). Sing l -> Sing l
16 fl (SNil :: Sing (l :: [y])) = SNil
17 fl (SCons x xs) = SCons x xs