summaryrefslogtreecommitdiff
path: root/testsuite/tests/unsatisfiable/T14339_Unsat.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/unsatisfiable/T14339_Unsat.hs')
-rw-r--r--testsuite/tests/unsatisfiable/T14339_Unsat.hs25
1 files changed, 25 insertions, 0 deletions
diff --git a/testsuite/tests/unsatisfiable/T14339_Unsat.hs b/testsuite/tests/unsatisfiable/T14339_Unsat.hs
new file mode 100644
index 0000000000..ffa0c141ab
--- /dev/null
+++ b/testsuite/tests/unsatisfiable/T14339_Unsat.hs
@@ -0,0 +1,25 @@
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE StandaloneDeriving #-}
+{-# LANGUAGE UndecidableInstances #-}
+
+module T14339_Unsat where
+
+import GHC.TypeError
+
+newtype Foo = Foo Int
+
+class Bar a where
+ bar :: a
+
+instance (Unsatisfiable (Text "Boo")) => Bar Foo where
+ bar = undefined
+
+newtype Baz1 = Baz1 Foo
+
+
+-- should be ok
+deriving instance Unsatisfiable (Text "Shouldn't see this") => Bar Baz1
+
+-- should emit the error "Boo"
+newtype Baz2 = Baz2 Foo
+ deriving Bar