[commit: ghc] wip/gitlab-registry, wip/over-poly-kinds: Fix exprIsConApp_maybe (c25b135)

git at git.haskell.org git at git.haskell.org
Sat Feb 23 19:22:32 UTC 2019


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

On branches: wip/gitlab-registry,wip/over-poly-kinds
Link       : http://ghc.haskell.org/trac/ghc/changeset/c25b135ff5b9c69a90df0ccf51b04952c2dc6ee1/ghc

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

commit c25b135ff5b9c69a90df0ccf51b04952c2dc6ee1
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Thu Feb 21 12:03:22 2019 +0000

    Fix exprIsConApp_maybe
    
    In this commit
       commit 7833cf407d1f608bebb1d38bb99d3035d8d735e6
       Date:   Thu Jan 24 17:58:50 2019 +0100
          Look through newtype wrappers (Trac #16254)
    
    we made exprIsConApp_maybe quite a bit cleverer.  But I had not paid
    enough attention to keeping exactly the correct substitution and
    in-scope set, which led to Trac #16348.
    
    There were several buglets (like applying the substitution twice in
    exprIsConApp_maybe, but the proximate source of the bug was that we were
    calling addNewInScopeIds, which deleted things from the substitution as
    well as adding them to the in-scope set.  That's usually right, but not
    here!
    
    This was quite tricky to track down.  But it is nicer now.


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

c25b135ff5b9c69a90df0ccf51b04952c2dc6ee1
 compiler/basicTypes/MkId.hs                        |   2 +-
 compiler/coreSyn/CoreOpt.hs                        | 105 ++++++++++++---------
 compiler/prelude/PrelRules.hs                      |   2 +-
 compiler/simplCore/Simplify.hs                     |  20 ++--
 testsuite/tests/simplCore/should_compile/T16348.hs |   6 ++
 testsuite/tests/simplCore/should_compile/all.T     |   1 +
 6 files changed, 81 insertions(+), 55 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 c25b135ff5b9c69a90df0ccf51b04952c2dc6ee1


More information about the ghc-commits mailing list