diff options
author | Sebastian Graf <sebastian.graf@kit.edu> | 2020-07-01 15:48:41 +0200 |
---|---|---|
committer | Sebastian Graf <sebastian.graf@kit.edu> | 2020-09-10 17:03:12 +0200 |
commit | 3777be14e104f040b826762f5ab42a8b898d85ae (patch) | |
tree | 1af2c1cc113db6f142486c111ca467bb8b7195a4 /compiler/GHC/Tc | |
parent | 6abe4a1c427a511aa698424055639ea789fccf97 (diff) | |
download | haskell-wip/T18341.tar.gz |
PmCheck: Handle ⊥ and strict fields correctly (#18341)wip/T18341
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.
Proper handling of ⊥ also fixes #17977 (once again) and fixes #18670.
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, #17977 and #18670.
Metric Decrease:
T12227
Diffstat (limited to 'compiler/GHC/Tc')
-rw-r--r-- | compiler/GHC/Tc/Types.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/GHC/Tc/Types.hs b/compiler/GHC/Tc/Types.hs index 5111dbbe3d..0af8bbb2a4 100644 --- a/compiler/GHC/Tc/Types.hs +++ b/compiler/GHC/Tc/Types.hs @@ -106,7 +106,7 @@ import GHC.Tc.Types.Origin import GHC.Types.Annotations import GHC.Core.InstEnv import GHC.Core.FamInstEnv -import {-# SOURCE #-} GHC.HsToCore.PmCheck.Types (Deltas) +import {-# SOURCE #-} GHC.HsToCore.PmCheck.Types (Nablas) import GHC.Data.IOEnv import GHC.Types.Name.Reader import GHC.Types.Name @@ -324,9 +324,9 @@ data DsLclEnv = DsLclEnv { dsl_loc :: RealSrcSpan, -- To put in pattern-matching error msgs -- See Note [Note [Long-distance information] in "GHC.HsToCore.PmCheck" - -- The set of reaching values Deltas is augmented as we walk inwards, + -- The set of reaching values Nablas is augmented as we walk inwards, -- refined through each pattern match in turn - dsl_deltas :: Deltas + dsl_nablas :: Nablas } -- Inside [| |] brackets, the desugarer looks |