[commit: ghc] wip/fix-validate: Fix exprIsConApp_maybe (448825e)
git at git.haskell.org
git at git.haskell.org
Thu Feb 21 19:32:14 UTC 2019
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/fix-validate
Link : http://ghc.haskell.org/trac/ghc/changeset/448825eb7270eb8e886269df9e311ae15306acd0/ghc
>---------------------------------------------------------------
commit 448825eb7270eb8e886269df9e311ae15306acd0
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.
>---------------------------------------------------------------
448825eb7270eb8e886269df9e311ae15306acd0
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 448825eb7270eb8e886269df9e311ae15306acd0
More information about the ghc-commits
mailing list