summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/T19577.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck/should_compile/T19577.hs')
-rw-r--r--testsuite/tests/typecheck/should_compile/T19577.hs24
1 files changed, 24 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T19577.hs b/testsuite/tests/typecheck/should_compile/T19577.hs
new file mode 100644
index 0000000000..5ec90ca3a0
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T19577.hs
@@ -0,0 +1,24 @@
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE TypeOperators #-}
+{-# LANGUAGE GADTs #-}
+{-# LANGUAGE LambdaCase #-}
+{-# LANGUAGE TypeApplications #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE RankNTypes #-}
+
+module T19577 where
+
+data SBool (b :: Bool) where
+ STrue :: forall b. (b ~ 'True) => SBool b
+ SFalse :: forall b. (b ~ 'False) => SBool b
+
+class Blah b where
+ blah :: SBool b
+
+instance Blah 'True where
+ blah = STrue
+
+foo :: Blah b => (SBool b -> Int) -> Int
+foo f = f blah
+
+bar = foo (\(STrue @True) -> 42)