diff options
author | Simon Peyton Jones <simon.peytonjones@gmail.com> | 2023-03-02 11:26:17 +0000 |
---|---|---|
committer | Simon Peyton Jones <simon.peytonjones@gmail.com> | 2023-03-03 08:13:44 +0000 |
commit | 53c4b80add408db9f305b61a5fe3abe23b0a55e1 (patch) | |
tree | 5cdfaf6b8289500a3968a086d6f95df3c3cb4156 /compiler/GHC/Core/Utils.hs | |
parent | 2f97c86151d7eed115ddcbdee1842684aed63176 (diff) | |
download | haskell-wip/T22023.tar.gz |
More fixes for `type data` declarationswip/T22023
This MR fixes #23022 and #23023. Specifically
* Beef up Note [Type data declarations] in GHC.Rename.Module,
to make invariant (I1) explicit, and to name the several
wrinkles.
And add references to these specific wrinkles.
* Add a Lint check for invariant (I1) above.
See GHC.Core.Lint.checkTypeDataConOcc
* Disable the `caseRules` for dataToTag# for `type data` values.
See Wrinkle (W2c) in the Note above. Fixes #23023.
* Refine the assertion in dataConRepArgTys, so that it does not
complain about the absence of a wrapper for a `type data` constructor
Fixes #23022.
Acked-by: Simon Peyton Jones <simon.peytonjones@gmail.com>
Diffstat (limited to 'compiler/GHC/Core/Utils.hs')
-rw-r--r-- | compiler/GHC/Core/Utils.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/GHC/Core/Utils.hs b/compiler/GHC/Core/Utils.hs index 89824889ef..21ceb2a7bb 100644 --- a/compiler/GHC/Core/Utils.hs +++ b/compiler/GHC/Core/Utils.hs @@ -845,7 +845,8 @@ There are two exceptions where we avoid refining a DEFAULT case: __DEFAULT -> () Namely, we do _not_ want to match on `A`, as it doesn't exist at the value - level! + level! See wrinkle (W2b) in Note [Type data declarations] in GHC.Rename.Module + Note [Combine identical alternatives] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |