summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2015-07-09 13:03:34 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2015-07-09 13:04:04 +0100
commitb5aabfbdb96ba8abf2748d089f40c267c2131215 (patch)
treef5b204c8c20f23ac8845363f18de5f2a5d78fcbd /testsuite/tests/typecheck/should_fail
parentc58dc1a149128dcc923b6cd2b20b0139e765c50d (diff)
downloadhaskell-b5aabfbdb96ba8abf2748d089f40c267c2131215.tar.gz
Infer types with flexible contexts
Responding to Trac #10608 and Trac #10351, I've reverted to making type inference infer structured constraint like f :: C [t] => t -> t even if -XFlexibleContexts is not set. That elicits an error message suggesting the flag. The result is more helpful than the error message you get otherwise.
Diffstat (limited to 'testsuite/tests/typecheck/should_fail')
-rw-r--r--testsuite/tests/typecheck/should_fail/T10351.stderr9
-rw-r--r--testsuite/tests/typecheck/should_fail/T6022.stderr12
-rw-r--r--testsuite/tests/typecheck/should_fail/T8883.stderr16
3 files changed, 18 insertions, 19 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T10351.stderr b/testsuite/tests/typecheck/should_fail/T10351.stderr
index 178005a705..58c28e463d 100644
--- a/testsuite/tests/typecheck/should_fail/T10351.stderr
+++ b/testsuite/tests/typecheck/should_fail/T10351.stderr
@@ -1,5 +1,6 @@
-T10351.hs:6:7: error:
- No instance for (C [t]) arising from a use of ‘op’
- In the expression: op [x]
- In an equation for ‘f’: f x = op [x]
+T10351.hs:6:1: error:
+ Non type-variable argument in the constraint: C [t]
+ (Use FlexibleContexts to permit this)
+ When checking that ‘f’ has the inferred type
+ f :: forall t. C [t] => t -> ()
diff --git a/testsuite/tests/typecheck/should_fail/T6022.stderr b/testsuite/tests/typecheck/should_fail/T6022.stderr
index a85c6289da..a3cd78e2e1 100644
--- a/testsuite/tests/typecheck/should_fail/T6022.stderr
+++ b/testsuite/tests/typecheck/should_fail/T6022.stderr
@@ -1,6 +1,6 @@
-
-T6022.hs:3:9: error:
- No instance for (Eq ([a] -> a)) arising from a use of ‘==’
- (maybe you haven't applied a function to enough arguments?)
- In the expression: x == head
- In an equation for ‘f’: f x = x == head
+
+T6022.hs:3:1: error:
+ Non type-variable argument in the constraint: Eq ([a] -> a)
+ (Use FlexibleContexts to permit this)
+ When checking that ‘f’ has the inferred type
+ f :: forall a. Eq ([a] -> a) => ([a] -> a) -> Bool
diff --git a/testsuite/tests/typecheck/should_fail/T8883.stderr b/testsuite/tests/typecheck/should_fail/T8883.stderr
index dc4bdfcca1..3f0a43033b 100644
--- a/testsuite/tests/typecheck/should_fail/T8883.stderr
+++ b/testsuite/tests/typecheck/should_fail/T8883.stderr
@@ -1,10 +1,8 @@
-T8883.hs:20:14: error:
- Could not deduce (Functor (PF a)) arising from a use of ‘fmap’
- from the context: Regular a
- bound by the inferred type of
- fold :: Regular a => (PF a b -> b) -> a -> b
- at T8883.hs:20:1-33
- In the first argument of ‘(.)’, namely ‘fmap (fold f)’
- In the second argument of ‘(.)’, namely ‘fmap (fold f) . from’
- In the expression: f . fmap (fold f) . from
+T8883.hs:20:1: error:
+ Non type-variable argument in the constraint: Functor (PF a)
+ (Use FlexibleContexts to permit this)
+ When checking that ‘fold’ has the inferred type
+ fold :: forall b a.
+ (Functor (PF a), Regular a) =>
+ (PF a b -> b) -> a -> b