diff options
Diffstat (limited to 'testsuite/tests/typecheck/should_fail/T18851c.hs')
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T18851c.hs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T18851c.hs b/testsuite/tests/typecheck/should_fail/T18851c.hs new file mode 100644 index 0000000000..f633d4674d --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T18851c.hs @@ -0,0 +1,25 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE PolyKinds #-} +{-# LANGUAGE StandaloneKindSignatures #-} +{-# LANGUAGE TypeFamilyDependencies #-} +{-# LANGUAGE TypeOperators #-} + +-- from https://gitlab.haskell.org/ghc/ghc/-/merge_requests/5899#note_407871 + +module T18851c where + +-- base +import Data.Kind (Type) + +data Nat +type Plus1 :: Nat -> Nat +type family Plus1 n = r | r -> n + +data V (n :: Nat) = V + +data VSucc n where + VSucc :: V n -> VSucc (Plus1 n) + +foo :: VSucc n -> VSucc n -> VSucc n +foo (VSucc _) (VSucc _) = VSucc V |