Don't generate wrappers for `type data` constructors with StrictData
Previously, the logic for checking if a data constructor needs a wrapper or not would take into account whether the constructor's fields have explicit strictness (e.g., `data T = MkT !Int`), but the logic would _not_ take into account whether `StrictData` was enabled. This meant that something like `type data T = MkT Int` would incorrectly generate a wrapper for `MkT` if `StrictData` was enabled, leading to the horrible errors seen in #24620. To fix this, we disable generating wrappers for `type data` constructors altogether. Fixes #24620. Co-authored-by:Ryan Scott <ryan.gl.scott@gmail.com>
Showing
- compiler/GHC/Iface/Tidy.hs 5 additions, 2 deletionscompiler/GHC/Iface/Tidy.hs
- compiler/GHC/Rename/Module.hs 2 additions, 0 deletionscompiler/GHC/Rename/Module.hs
- compiler/GHC/Types/Id/Make.hs 14 additions, 16 deletionscompiler/GHC/Types/Id/Make.hs
- testsuite/tests/type-data/should_run/T24620.hs 9 additions, 0 deletionstestsuite/tests/type-data/should_run/T24620.hs
- testsuite/tests/type-data/should_run/all.T 1 addition, 0 deletionstestsuite/tests/type-data/should_run/all.T
Loading
Please register or sign in to comment