[commit: ghc] master: Make the matcher and wrapper Ids in PatSyn into LocalIds, not GlobalIds (7ac600d)
git at git.haskell.org
git at git.haskell.org
Fri Jun 6 12:06:15 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/7ac600d5fcd74db1f991555de6e415030970d5f3/ghc
>---------------------------------------------------------------
commit 7ac600d5fcd74db1f991555de6e415030970d5f3
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Fri Jun 6 11:39:41 2014 +0100
Make the matcher and wrapper Ids in PatSyn into LocalIds, not GlobalIds
This was a serious bug, exposed by Trac #9175. The matcher and wrapper
must be LocalIds, like record selectors and dictionary functions, for
the reasons now documented in Note [Exported LocalIds] in Id.lhs
In fixing this I found
- PatSyn should have an Id inside it (apart from the wrapper and matcher)
It should be a Name. Hence psId --> psName, with knock-on consequences
- Tidying of PatSyns in TidyPgm was wrong
- The keep-alive set in Desugar.deSugar (now) doesn't need pattern synonyms
in it
I also cleaned up the interface to PatSyn a little, so there's a tiny knock-on
effect in Haddock; hence the haddock submodule update.
It's very hard to make a test for this bug, so I haven't.
>---------------------------------------------------------------
7ac600d5fcd74db1f991555de6e415030970d5f3
compiler/basicTypes/Id.lhs | 39 +++++++++++++-
compiler/basicTypes/MkId.lhs | 31 +++--------
compiler/basicTypes/PatSyn.lhs | 77 +++++++++++++++++-----------
compiler/deSugar/Desugar.lhs | 21 +++-----
compiler/deSugar/MatchCon.lhs | 2 +-
compiler/hsSyn/Convert.lhs | 2 +-
compiler/iface/MkIface.lhs | 4 +-
compiler/main/HscTypes.lhs | 20 ++------
compiler/main/TidyPgm.lhs | 52 +++++++++++--------
compiler/typecheck/TcEnv.lhs | 3 +-
compiler/typecheck/TcPat.lhs | 4 +-
compiler/typecheck/TcPatSyn.lhs | 5 +-
compiler/typecheck/TcRnDriver.lhs | 5 +-
compiler/typecheck/TcRnTypes.lhs | 4 +-
compiler/typecheck/TcSplice.lhs | 4 +-
compiler/typecheck/TcTyClsDecls.lhs | 7 ++-
compiler/vectorise/Vectorise/Monad/Naming.hs | 5 +-
utils/haddock | 2 +-
18 files changed, 154 insertions(+), 133 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 7ac600d5fcd74db1f991555de6e415030970d5f3
More information about the ghc-commits
mailing list