diff options
Diffstat (limited to 'testsuite/tests/indexed-types/should_compile/T3851.hs')
-rw-r--r-- | testsuite/tests/indexed-types/should_compile/T3851.hs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/testsuite/tests/indexed-types/should_compile/T3851.hs b/testsuite/tests/indexed-types/should_compile/T3851.hs new file mode 100644 index 0000000000..3b40db1bce --- /dev/null +++ b/testsuite/tests/indexed-types/should_compile/T3851.hs @@ -0,0 +1,24 @@ +{-# LANGUAGE GADTs, TypeFamilies #-}
+
+module T3851 where
+
+type family TF a :: * -> *
+type instance TF () = App (Equ ())
+
+data Equ ix ix' where Refl :: Equ ix ix
+data App f x = App (f x)
+
+-- does not typecheck in 6.12.1 (but works in 6.10.4)
+bar :: TF () () -> ()
+bar (App Refl) = ()
+
+-- does typecheck in 6.12.1 and 6.10.4
+ar :: App (Equ ()) () -> ()
+ar (App Refl) = ()
+
+------------------
+data family DF a :: * -> *
+data instance DF () a = D (App (Equ ()) a)
+
+bar_df :: DF () () -> ()
+bar_df (D (App Refl)) = ()
|