Fix exprIsConApp_maybe
In this commit commit 7833cf40 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.
Showing
- compiler/basicTypes/MkId.hs 1 addition, 1 deletioncompiler/basicTypes/MkId.hs
- compiler/coreSyn/CoreOpt.hs 62 additions, 43 deletionscompiler/coreSyn/CoreOpt.hs
- compiler/prelude/PrelRules.hs 1 addition, 1 deletioncompiler/prelude/PrelRules.hs
- compiler/simplCore/Simplify.hs 10 additions, 10 deletionscompiler/simplCore/Simplify.hs
- testsuite/tests/simplCore/should_compile/T16348.hs 6 additions, 0 deletionstestsuite/tests/simplCore/should_compile/T16348.hs
- testsuite/tests/simplCore/should_compile/all.T 1 addition, 0 deletionstestsuite/tests/simplCore/should_compile/all.T
Loading
Please register or sign in to comment