[commit: ghc] wip/rae: Fix #13819 by refactoring TypeEqOrigin.uo_thing (ea32578)
git at git.haskell.org
git at git.haskell.org
Wed Jul 19 12:03:56 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/rae
Link : http://ghc.haskell.org/trac/ghc/changeset/ea325787959da884a23f45f405bf9e3ee6329f59/ghc
>---------------------------------------------------------------
commit ea325787959da884a23f45f405bf9e3ee6329f59
Author: Richard Eisenberg <rae at cs.brynmawr.edu>
Date: Wed Jun 14 16:35:18 2017 -0400
Fix #13819 by refactoring TypeEqOrigin.uo_thing
The uo_thing field of TypeEqOrigin is used to track the
"thing" (either term or type) that has the type (kind) stored
in the TypeEqOrigin fields. Previously, this was sometimes a
proper Core Type, which needed zonking and tidying. Now, it
is only HsSyn: much simpler, and the error messages now use
the user-written syntax.
But this aspect of uo_thing didn't cause #13819; it was the
sibling field uo_arity that did. uo_arity stored the number
of arguments of uo_thing, useful when reporting something
like "should have written 2 fewer arguments". We wouldn't want
to say that if the thing didn't have two arguments. However,
in practice, GHC was getting this wrong, and this message
didn't seem all that helpful. Furthermore, the calculation
of the number of arguments is what caused #13819 to fall over.
This patch just removes uo_arity. In my opinion, the change
to error messages is a nudge in the right direction.
Test case: typecheck/should_fail/T13819
>---------------------------------------------------------------
ea325787959da884a23f45f405bf9e3ee6329f59
compiler/ghci/RtClosureInspect.hs | 4 +-
compiler/typecheck/Inst.hs | 8 +-
compiler/typecheck/TcArrows.hs | 2 +-
compiler/typecheck/TcErrors.hs | 20 ++-
compiler/typecheck/TcExpr.hs | 50 ++++----
compiler/typecheck/TcHsType.hs | 135 +++++++++++----------
compiler/typecheck/TcMType.hs | 30 +----
compiler/typecheck/TcPat.hs | 6 +-
compiler/typecheck/TcRnTypes.hs | 21 +---
compiler/typecheck/TcSigs.hs | 4 +-
compiler/typecheck/TcSplice.hs | 13 +-
compiler/typecheck/TcSplice.hs-boot | 6 +-
compiler/typecheck/TcTyClsDecls.hs | 2 +-
compiler/typecheck/TcType.hs | 7 ++
compiler/typecheck/TcUnify.hs | 65 +++++-----
compiler/typecheck/TcUnify.hs-boot | 7 +-
compiler/types/Type.hs | 2 +-
.../tests/indexed-types/should_fail/T12867.stderr | 3 +-
testsuite/tests/polykinds/T12593.stderr | 7 +-
testsuite/tests/polykinds/T6039.stderr | 3 +-
testsuite/tests/polykinds/T7278.stderr | 3 +-
testsuite/tests/polykinds/T8616.stderr | 2 +-
testsuite/tests/polykinds/T9200b.stderr | 6 +-
.../tests/rename/should_fail/rnfail026.stderr | 3 +-
testsuite/tests/th/T3177a.stderr | 6 +-
.../tests/typecheck/should_fail/T11356.stderr | 3 +-
.../tests/typecheck/should_fail/T11672.stderr | 11 +-
.../tests/typecheck/should_fail/T12785b.stderr | 6 +
testsuite/tests/typecheck/should_fail/T13819.hs | 14 +++
.../tests/typecheck/should_fail/T13819.stderr | 18 +++
testsuite/tests/typecheck/should_fail/T2994.stderr | 3 +-
testsuite/tests/typecheck/should_fail/T3540.stderr | 2 +-
testsuite/tests/typecheck/should_fail/T4875.stderr | 6 +-
testsuite/tests/typecheck/should_fail/T7609.stderr | 11 +-
testsuite/tests/typecheck/should_fail/T7778.stderr | 10 +-
testsuite/tests/typecheck/should_fail/all.T | 1 +
.../tests/typecheck/should_fail/tcfail070.stderr | 3 +-
.../tests/typecheck/should_fail/tcfail078.stderr | 6 +-
.../tests/typecheck/should_fail/tcfail113.stderr | 12 +-
.../tests/typecheck/should_fail/tcfail123.stderr | 9 --
.../tests/typecheck/should_fail/tcfail132.stderr | 3 +-
41 files changed, 243 insertions(+), 290 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 ea325787959da884a23f45f405bf9e3ee6329f59
More information about the ghc-commits
mailing list