summaryrefslogtreecommitdiff
path: root/testsuite/tests/partial-sigs/should_compile/T12845.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/partial-sigs/should_compile/T12845.hs')
-rw-r--r--testsuite/tests/partial-sigs/should_compile/T12845.hs23
1 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/tests/partial-sigs/should_compile/T12845.hs b/testsuite/tests/partial-sigs/should_compile/T12845.hs
new file mode 100644
index 0000000000..d9b8a99657
--- /dev/null
+++ b/testsuite/tests/partial-sigs/should_compile/T12845.hs
@@ -0,0 +1,23 @@
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE PartialTypeSignatures #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE TypeFamilies #-}
+{-# LANGUAGE TypeOperators #-}
+
+module T12845 where
+
+import Data.Proxy
+
+data Foo (m :: Bool)
+
+type family Head (xs :: [(Bool, Bool)]) where Head (x ': xs) = x
+
+type family Bar (x :: Bool) (y :: Bool) :: Bool
+
+-- to trigger the bug, r and r' cannot *both* appear on the RHS
+broken :: forall r r' rngs . ('(r,r') ~ Head rngs, Bar r r' ~ 'True, _)
+ => Foo r -> Proxy rngs -> ()
+broken x _ = let y = requireBar x :: Foo r' in ()
+
+requireBar :: (Bar m m' ~ 'True) => Foo m -> Foo m'
+requireBar = undefined