Fix map/coerce rule for newtypes with wrappers
authorKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>
Tue, 26 Feb 2019 16:22:28 +0000 (17:22 +0100)
committerMarge Bot <ben+marge-bot@smart-cactus.org>
Tue, 5 Mar 2019 08:21:53 +0000 (03:21 -0500)
commit646b6dfbe125aa756a935e840979ba11b4a882c0
treee8366482a323813646cf054bba5462741128c606
parent6c4e45b043b0577d64e5addf5eaf6503e4a10b23
Fix map/coerce rule for newtypes with wrappers

This addresses Trac #16208 by marking newtype wrapper
unfoldings as compulsory.

Furthermore, we can remove the special case for newtypes
in exprIsConApp_maybe (introduced in 7833cf407d1f).
compiler/basicTypes/MkId.hs
compiler/coreSyn/CoreOpt.hs
compiler/coreSyn/CoreUtils.hs
testsuite/tests/simplCore/should_run/T16208.hs [new file with mode: 0644]
testsuite/tests/simplCore/should_run/T16208.stdout [new file with mode: 0644]
testsuite/tests/simplCore/should_run/all.T