diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2015-04-30 09:18:49 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2015-04-30 09:22:20 +0100 |
commit | b83160d07e626bee685f329a9a73e90a4a6074ae (patch) | |
tree | aba7948b3d73a3b05db887da48905fec73c62e69 /testsuite/tests/typecheck/should_fail/T10351.hs | |
parent | 54cefbd753b516fe8645c1470750ad7f65352844 (diff) | |
download | haskell-b83160d07e626bee685f329a9a73e90a4a6074ae.tar.gz |
Tidy up treatment of FlexibleContexts
Previously (Trac #10351) we could get
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 -> ()
which is a bit stupid: we have *inferred* a type that we
immediately *reject*. This patch arranges that that the
generalisation mechanism (TcSimplify.decideQuantification)
doesn't pick a predicate that will be rejected by the
subsequent validity check.
This forced some minor refactoring, as usual.
Diffstat (limited to 'testsuite/tests/typecheck/should_fail/T10351.hs')
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T10351.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T10351.hs b/testsuite/tests/typecheck/should_fail/T10351.hs new file mode 100644 index 0000000000..411698b397 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T10351.hs @@ -0,0 +1,6 @@ +module T10351 where + +class C a where + op :: a -> () + +f x = op [x] |