summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/T19977b.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck/should_fail/T19977b.hs')
-rw-r--r--testsuite/tests/typecheck/should_fail/T19977b.hs21
1 files changed, 21 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T19977b.hs b/testsuite/tests/typecheck/should_fail/T19977b.hs
new file mode 100644
index 0000000000..6f7bf0f033
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T19977b.hs
@@ -0,0 +1,21 @@
+{-# LANGUAGE Haskell2010 #-}
+{-# LANGUAGE
+ FlexibleContexts,
+ FlexibleInstances,
+ UndecidableInstances,
+ NoMonomorphismRestriction
+#-}
+
+module T19977b where
+
+-- See Note [Inferring principal types] in Ghc.Tc.Solver
+
+class C a
+class D a where
+ d :: a
+instance C a => D a where
+ d = undefined
+h = d
+
+g :: D a => a
+g = h