Fix TypeData issues (fixes #22315 and #22332)
There were two bugs here: 1. Treating type-level constructors as PromotedDataCon doesn't always work, in particular because constructors promoted via DataKinds are called both T and 'T. (Tests T22332a, T22332b, T22315a, T22315b) Fix: guard these cases with isDataKindsPromotedDataCon. 2. Type-level constructors were sent to the code generator, producing things like constructor wrappers. (Tests T22332a, T22332b) Fix: test for them in isDataTyCon. Other changes: * changed the marking of "type data" DataCon's as suggested by SPJ. * added a test TDGADT for a type-level GADT. * comment tweaks * change tcIfaceTyCon to ignore IfaceTyConInfo, so that IfaceTyConInfo is used only for pretty printing, not for typechecking. (SPJ)
Showing
- compiler/GHC/Core/DataCon.hs 1 addition, 1 deletioncompiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/DataCon.hs-boot 1 addition, 0 deletionscompiler/GHC/Core/DataCon.hs-boot
- compiler/GHC/Core/TyCon.hs 42 additions, 8 deletionscompiler/GHC/Core/TyCon.hs
- compiler/GHC/CoreToIface.hs 1 addition, 1 deletioncompiler/GHC/CoreToIface.hs
- compiler/GHC/Iface/Make.hs 5 additions, 4 deletionscompiler/GHC/Iface/Make.hs
- compiler/GHC/Iface/Rename.hs 2 additions, 2 deletionscompiler/GHC/Iface/Rename.hs
- compiler/GHC/Iface/Syntax.hs 24 additions, 14 deletionscompiler/GHC/Iface/Syntax.hs
- compiler/GHC/Iface/Type.hs 6 additions, 2 deletionscompiler/GHC/Iface/Type.hs
- compiler/GHC/IfaceToCore.hs 8 additions, 6 deletionscompiler/GHC/IfaceToCore.hs
- compiler/GHC/Rename/Module.hs 51 additions, 28 deletionscompiler/GHC/Rename/Module.hs
- compiler/GHC/Tc/Instance/Typeable.hs 1 addition, 1 deletioncompiler/GHC/Tc/Instance/Typeable.hs
- compiler/GHC/Tc/TyCl.hs 2 additions, 1 deletioncompiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/TyCl/Instance.hs 2 additions, 1 deletioncompiler/GHC/Tc/TyCl/Instance.hs
- compiler/GHC/Types/TyThing.hs 11 additions, 5 deletionscompiler/GHC/Types/TyThing.hs
- testsuite/tests/type-data/should_compile/T22315a/Lib.hs 12 additions, 0 deletionstestsuite/tests/type-data/should_compile/T22315a/Lib.hs
- testsuite/tests/type-data/should_compile/T22315a/Main.hs 9 additions, 0 deletionstestsuite/tests/type-data/should_compile/T22315a/Main.hs
- testsuite/tests/type-data/should_compile/TDGADT.hs 13 additions, 0 deletionstestsuite/tests/type-data/should_compile/TDGADT.hs
- testsuite/tests/type-data/should_compile/all.T 2 additions, 0 deletionstestsuite/tests/type-data/should_compile/all.T
- testsuite/tests/type-data/should_fail/T22332b.hs 9 additions, 0 deletionstestsuite/tests/type-data/should_fail/T22332b.hs
- testsuite/tests/type-data/should_fail/T22332b.stderr 7 additions, 0 deletionstestsuite/tests/type-data/should_fail/T22332b.stderr
Loading
Please register or sign in to comment