[commit: ghc] master: Fix egregious instantiation bug in matchOneConLike (fixing Trac #9023) (0a55a3c)

git at git.haskell.org git at git.haskell.org
Thu Jun 5 10:04:14 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/0a55a3cada2fea37586b1a270c1511ed9957dbd4/ghc

>---------------------------------------------------------------

commit 0a55a3cada2fea37586b1a270c1511ed9957dbd4
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.


>---------------------------------------------------------------

0a55a3cada2fea37586b1a270c1511ed9957dbd4
 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 0a55a3cada2fea37586b1a270c1511ed9957dbd4


More information about the ghc-commits mailing list