[commit: ghc] ghc-7.8: Fix egregious instantiation bug in matchOneConLike (fixing Trac #9023) (d1c2a27)
git at git.haskell.org
git at git.haskell.org
Mon Jun 23 09:07:35 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : ghc-7.8
Link : http://ghc.haskell.org/trac/ghc/changeset/d1c2a2784ffc120bdd8f1fccc9cc61933c0cc5d0/ghc
>---------------------------------------------------------------
commit d1c2a2784ffc120bdd8f1fccc9cc61933c0cc5d0
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Thu Jun 5 11:03:45 2014 +0100
Fix egregious instantiation bug in matchOneConLike (fixing Trac #9023)
We simply weren't giving anything like the right instantiating types
to patSynInstArgTys in matchOneConLike.
To get these instantiating types would have involved matching the
result type of the pattern synonym with the pattern type, which is
tiresome. So instead I changed ConPatOut so that instead of recording
the type of the *whole* pattern (in old field pat_ty), it not records
the *instantiating* types (in new field pat_arg_tys). Then we canuse
TcHsSyn.conLikeResTy to get the pattern type when needed.
There are lots of knock-on incidental effects, but they mostly made
the code simpler, so I'm happy.
Conflicts:
compiler/typecheck/TcPat.lhs
(cherry picked from commit 1fc4f6b973a4fb14b2b15143b2774ec597b4da0f)
>---------------------------------------------------------------
d1c2a2784ffc120bdd8f1fccc9cc61933c0cc5d0
compiler/basicTypes/PatSyn.lhs | 25 +++++++++++++++++++++++--
compiler/deSugar/Check.lhs | 32 +++++++++++++++-----------------
compiler/deSugar/DsExpr.lhs | 2 +-
compiler/deSugar/DsUtils.lhs | 3 +--
compiler/deSugar/Match.lhs | 11 +++++------
compiler/deSugar/MatchCon.lhs | 33 +++++++++++++++------------------
compiler/deSugar/MatchLit.lhs | 6 +++---
compiler/hsSyn/Convert.lhs | 4 ++--
compiler/hsSyn/HsPat.lhs | 31 ++++++++++++++++++++-----------
compiler/hsSyn/HsUtils.lhs | 2 +-
compiler/parser/RdrHsSyn.lhs | 2 +-
compiler/rename/RnPat.lhs | 2 +-
compiler/typecheck/TcHsSyn.lhs | 24 ++++++++++++++++--------
compiler/typecheck/TcPat.lhs | 19 ++++++++++---------
14 files changed, 114 insertions(+), 82 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 d1c2a2784ffc120bdd8f1fccc9cc61933c0cc5d0
More information about the ghc-commits
mailing list