Use TcRnVDQInTermType in noNestedForallsContextsErr (#20115)
When faced with VDQ in the type of a term, GHC generates the following error message: Illegal visible, dependent quantification in the type of a term (GHC does not yet support this) Prior to this patch, there were two ways this message could have been generated and represented: 1. with the dedicated constructor TcRnVDQInTermType (see check_type in GHC.Tc.Validity) 2. with the transitional constructor TcRnUnknownMessage (see noNestedForallsContextsErr in GHC.Rename.Utils) Not only this led to duplication of code generating the final SDoc, it also made it tricky to track the origin of the error message. This patch fixes the problem by using TcRnVDQInTermType exclusively.
Showing
- compiler/GHC/Rename/Module.hs 3 additions, 4 deletionscompiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Utils.hs 4 additions, 7 deletionscompiler/GHC/Rename/Utils.hs
- compiler/GHC/Tc/Errors/Ppr.hs 8 additions, 4 deletionscompiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs 1 addition, 1 deletioncompiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Validity.hs 10 additions, 4 deletionscompiler/GHC/Tc/Validity.hs
- testsuite/tests/dependent/should_fail/T16326_Fail6.stderr 1 addition, 1 deletiontestsuite/tests/dependent/should_fail/T16326_Fail6.stderr
- testsuite/tests/dependent/should_fail/T16326_Fail8.stderr 1 addition, 1 deletiontestsuite/tests/dependent/should_fail/T16326_Fail8.stderr
- testsuite/tests/dependent/should_fail/T18271.stderr 1 addition, 1 deletiontestsuite/tests/dependent/should_fail/T18271.stderr
Loading
Please register or sign in to comment