[commit: ghc] master: Tidy up treatment of FlexibleContexts (b83160d)
git at git.haskell.org
git at git.haskell.org
Thu Apr 30 08:22:06 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/b83160d07e626bee685f329a9a73e90a4a6074ae/ghc
>---------------------------------------------------------------
commit b83160d07e626bee685f329a9a73e90a4a6074ae
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Thu Apr 30 09:18:49 2015 +0100
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.
>---------------------------------------------------------------
b83160d07e626bee685f329a9a73e90a4a6074ae
compiler/main/DynFlags.hs | 5 -
compiler/typecheck/TcBinds.hs | 5 +-
compiler/typecheck/TcSimplify.hs | 57 ++++++-----
compiler/typecheck/TcType.hs | 31 ++++++
compiler/typecheck/TcValidity.hs | 109 +++++++++------------
testsuite/tests/typecheck/should_fail/T10351.hs | 6 ++
.../tests/typecheck/should_fail/T10351.stderr | 5 +
testsuite/tests/typecheck/should_fail/T6022.stderr | 11 ++-
testsuite/tests/typecheck/should_fail/T8883.stderr | 16 +--
testsuite/tests/typecheck/should_fail/all.T | 1 +
.../tests/typecheck/should_fail/tcfail108.stderr | 9 +-
11 files changed, 147 insertions(+), 108 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc b83160d07e626bee685f329a9a73e90a4a6074ae
More information about the ghc-commits
mailing list