PmCheck: Handle ⊥ and strict fields correctly (#18341)
In #18341, we discovered an incorrect digression from Lower Your Guards. This MR changes what's necessary to support properly fixing #18341. In particular, bottomness constraints are now properly tracked in the oracle/inhabitation testing, as an additional field `vi_bot :: Maybe Bool` in `VarInfo`. That in turn allows us to model newtypes as advertised in the Appendix of LYG and fix #17725. For some reason I couldn't follow, this also fixes #18273. I also added a couple of regression tests that were missing. Most of them were already fixed before. In summary, this patch fixes #18341, #17725, #18273. Metric Decrease: T12227
Showing
- compiler/GHC/Core/DataCon.hs 5 additions, 1 deletioncompiler/GHC/Core/DataCon.hs
- compiler/GHC/Data/Bag.hs 7 additions, 2 deletionscompiler/GHC/Data/Bag.hs
- compiler/GHC/HsToCore/Binds.hs 2 additions, 2 deletionscompiler/GHC/HsToCore/Binds.hs
- compiler/GHC/HsToCore/Expr.hs 4 additions, 4 deletionscompiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/GuardedRHSs.hs 25 additions, 25 deletionscompiler/GHC/HsToCore/GuardedRHSs.hs
- compiler/GHC/HsToCore/Match.hs 19 additions, 19 deletionscompiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/Monad.hs 8 additions, 8 deletionscompiler/GHC/HsToCore/Monad.hs
- compiler/GHC/HsToCore/PmCheck.hs 147 additions, 129 deletionscompiler/GHC/HsToCore/PmCheck.hs
- compiler/GHC/HsToCore/PmCheck/Oracle.hs 279 additions, 252 deletionscompiler/GHC/HsToCore/PmCheck/Oracle.hs
- compiler/GHC/HsToCore/PmCheck/Ppr.hs 25 additions, 25 deletionscompiler/GHC/HsToCore/PmCheck/Ppr.hs
- compiler/GHC/HsToCore/PmCheck/Types.hs 61 additions, 27 deletionscompiler/GHC/HsToCore/PmCheck/Types.hs
- compiler/GHC/HsToCore/PmCheck/Types.hs-boot 3 additions, 3 deletionscompiler/GHC/HsToCore/PmCheck/Types.hs-boot
- compiler/GHC/Tc/Types.hs 3 additions, 3 deletionscompiler/GHC/Tc/Types.hs
- testsuite/tests/pmcheck/should_compile/T10183.hs 22 additions, 0 deletionstestsuite/tests/pmcheck/should_compile/T10183.hs
- testsuite/tests/pmcheck/should_compile/T17340.stderr 4 additions, 0 deletionstestsuite/tests/pmcheck/should_compile/T17340.stderr
- testsuite/tests/pmcheck/should_compile/T17378.hs 30 additions, 0 deletionstestsuite/tests/pmcheck/should_compile/T17378.hs
- testsuite/tests/pmcheck/should_compile/T17725.hs 10 additions, 0 deletionstestsuite/tests/pmcheck/should_compile/T17725.hs
- testsuite/tests/pmcheck/should_compile/T17725.stderr 4 additions, 0 deletionstestsuite/tests/pmcheck/should_compile/T17725.stderr
- testsuite/tests/pmcheck/should_compile/T17729.hs 13 additions, 0 deletionstestsuite/tests/pmcheck/should_compile/T17729.hs
- testsuite/tests/pmcheck/should_compile/T17729.stderr 4 additions, 0 deletionstestsuite/tests/pmcheck/should_compile/T17729.stderr
Loading
Please register or sign in to comment