[commit: ghc] master: Don't infer CallStacks (7407a66)
git at git.haskell.org
git at git.haskell.org
Mon Apr 4 11:07:06 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/7407a66d5bd29aa011f5a4228c6e2b2f7f8ad3f8/ghc
>---------------------------------------------------------------
commit 7407a66d5bd29aa011f5a4228c6e2b2f7f8ad3f8
Author: Eric Seidel <gridaphobe at gmail.com>
Date: Mon Apr 4 12:05:01 2016 +0200
Don't infer CallStacks
We originally wanted CallStacks to be opt-in, but dealing with let
binders complicated things, forcing us to infer CallStacks. It turns
out that the inference is actually unnecessary though, we can let the
wanted CallStacks bubble up to the outer context by refusing to
quantify over them. Eventually they'll be solved from a given CallStack
or defaulted to the empty CallStack if they reach the top.
So this patch prevents GHC from quantifying over CallStacks, getting us
back to the original plan. There's a small ugliness to do with
PartialTypeSignatures, if the partial theta contains a CallStack
constraint, we *do* want to quantify over the CallStack; the user asked
us to!
Note that this means that
foo :: _ => CallStack
foo = getCallStack callStack
will be an *empty* CallStack, since we won't infer a CallStack for the
hole in the theta. I think this is the right move though, since we want
CallStacks to be opt-in. One can always write
foo :: (HasCallStack, _) => CallStack
foo = getCallStack callStack
to get the CallStack and still have GHC infer the rest of the theta.
Test Plan: ./validate
Reviewers: goldfire, simonpj, austin, hvr, bgamari
Reviewed By: simonpj, bgamari
Subscribers: bitemyapp, thomie
Projects: #ghc
Differential Revision: https://phabricator.haskell.org/D1912
GHC Trac Issues: #11573
>---------------------------------------------------------------
7407a66d5bd29aa011f5a4228c6e2b2f7f8ad3f8
compiler/typecheck/TcBinds.hs | 4 +-
compiler/typecheck/TcEvidence.hs | 3 ++
compiler/typecheck/TcInteract.hs | 2 +-
compiler/typecheck/TcRnTypes.hs | 18 +-------
compiler/typecheck/TcSimplify.hs | 6 +--
compiler/typecheck/TcType.hs | 43 +++++++++++++++++--
docs/users_guide/glasgow_exts.rst | 50 +++++++++++-----------
libraries/base/GHC/Stack.hs | 6 +--
libraries/base/GHC/Stack/Types.hs | 16 +++----
testsuite/tests/codeGen/should_run/cgrun059.stderr | 3 +-
.../tests/concurrent/should_run/conc021.stderr | 3 +-
testsuite/tests/deSugar/should_run/T11601.stderr | 1 -
.../tests/ghci.debugger/scripts/break017.stdout | 5 +--
.../tests/ghci.debugger/scripts/print033.stdout | 3 +-
testsuite/tests/ghci/scripts/T5557.stdout | 10 ++---
testsuite/tests/ghci/scripts/ghci013.stdout | 3 +-
testsuite/tests/ghci/scripts/ghci046.stdout | 4 +-
testsuite/tests/ghci/scripts/ghci055.stdout | 7 ++-
.../should_compile/ExtraConstraints3.stderr | 7 ++-
.../tests/partial-sigs/should_fail/T10999.stderr | 8 +---
testsuite/tests/typecheck/should_run/T10845.hs | 11 +----
testsuite/tests/typecheck/should_run/T10845.stdout | 7 +--
testsuite/tests/typecheck/should_run/T8119.stdout | 3 +-
23 files changed, 111 insertions(+), 112 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 7407a66d5bd29aa011f5a4228c6e2b2f7f8ad3f8
More information about the ghc-commits
mailing list