[commit: ghc] ghc-7.8: Fix egregious instantiation bug in matchOneConLike (fixing Trac #9023) (f895f33)
git at git.haskell.org
git at git.haskell.org
Thu Jul 3 22:26:15 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : ghc-7.8
Link : http://ghc.haskell.org/trac/ghc/changeset/f895f334d117b8295471897c527dd57335e75eb7/ghc
>---------------------------------------------------------------
commit f895f334d117b8295471897c527dd57335e75eb7
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.
(cherry picked from commit 0a55a3cada2fea37586b1a270c1511ed9957dbd4)
>---------------------------------------------------------------
f895f334d117b8295471897c527dd57335e75eb7
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 | 18 +++++++++---------
14 files changed, 113 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 f895f334d117b8295471897c527dd57335e75eb7
More information about the ghc-commits
mailing list