summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/T12936.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2016-12-09 17:37:28 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2016-12-12 11:56:32 +0000
commitf1036ad80efb9cf80977fa234f8b9c7b23cc6835 (patch)
tree369296f37578b0a2502123b9b0009dd983a37f61 /testsuite/tests/typecheck/should_compile/T12936.hs
parent818e027e2db2ac291c44a5e07ae151505f3908b8 (diff)
downloadhaskell-f1036ad80efb9cf80977fa234f8b9c7b23cc6835.tar.gz
Make dropDerivedSimples restore [WD] constraints
I'd forgotten to turn [W] + [D] constraints back into [WD] in dropDerivedSimples; and that led to Trac #12936. Fortunately the fix is simple.
Diffstat (limited to 'testsuite/tests/typecheck/should_compile/T12936.hs')
-rw-r--r--testsuite/tests/typecheck/should_compile/T12936.hs30
1 files changed, 30 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T12936.hs b/testsuite/tests/typecheck/should_compile/T12936.hs
new file mode 100644
index 0000000000..c4f966093f
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T12936.hs
@@ -0,0 +1,30 @@
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE FunctionalDependencies #-}
+{-# LANGUAGE MonomorphismRestriction #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+module Token where
+
+class S s t | s -> t
+
+m :: forall s t . S s t => s
+m = undefined
+
+o :: forall s t . S s t => s -> s
+o = undefined
+
+c :: forall s . s -> s -> s
+c = undefined
+
+p :: forall s . S s () => s -> s
+p d = f
+ where
+
+ -- declaring either of these type signatures will cause the bug to go away
+
+ -- f :: s
+ f = c d (o e)
+
+ -- e :: s
+ e = c m m