Compute all emitted diagnostic codes
This commit introduces in GHC.Types.Error.Codes the function constructorCodes :: forall diag. (...) => Map DiagnosticCode String which computes a collection of all the diagnostic codes that correspond to a particular type. In particular, we can compute the collection of all diagnostic codes emitted by GHC using the invocation constructorCodes @GhcMessage We then make use of this functionality in the new "codes" test which checks consistency and coverage of GHC diagnostic codes. It performs three checks: - check 1: all non-outdated GhcDiagnosticCode equations are statically used. - check 2: all outdated GhcDiagnosticCode equations are statically unused. - check 3: all statically used diagnostic codes are covered by the testsuite (modulo accepted exceptions).
Showing
- compiler/GHC/Driver/Errors/Ppr.hs 1 addition, 1 deletioncompiler/GHC/Driver/Errors/Ppr.hs
- compiler/GHC/HsToCore/Errors/Ppr.hs 1 addition, 1 deletioncompiler/GHC/HsToCore/Errors/Ppr.hs
- compiler/GHC/Iface/Errors/Ppr.hs 1 addition, 1 deletioncompiler/GHC/Iface/Errors/Ppr.hs
- compiler/GHC/Parser/Errors/Ppr.hs 1 addition, 1 deletioncompiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Ppr.hs 1 addition, 2 deletionscompiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Types/Error.hs 8 additions, 7 deletionscompiler/GHC/Types/Error.hs
- compiler/GHC/Types/Error/Codes.hs 122 additions, 21 deletionscompiler/GHC/Types/Error/Codes.hs
- hadrian/src/Packages.hs 4 additions, 3 deletionshadrian/src/Packages.hs
- hadrian/src/Rules/Test.hs 8 additions, 0 deletionshadrian/src/Rules/Test.hs
- hadrian/src/Settings/Default.hs 10 additions, 2 deletionshadrian/src/Settings/Default.hs
- linters/lint-codes/LintCodes/Coverage.hs 46 additions, 0 deletionslinters/lint-codes/LintCodes/Coverage.hs
- linters/lint-codes/LintCodes/Static.hs 179 additions, 0 deletionslinters/lint-codes/LintCodes/Static.hs
- linters/lint-codes/Main.hs 158 additions, 0 deletionslinters/lint-codes/Main.hs
- linters/lint-codes/Makefile 15 additions, 0 deletionslinters/lint-codes/Makefile
- linters/lint-codes/cabal.project 1 addition, 0 deletionslinters/lint-codes/cabal.project
- linters/lint-codes/ghc.mk 18 additions, 0 deletionslinters/lint-codes/ghc.mk
- linters/lint-codes/lint-codes.cabal 42 additions, 0 deletionslinters/lint-codes/lint-codes.cabal
- testsuite/mk/boilerplate.mk 4 additions, 0 deletionstestsuite/mk/boilerplate.mk
- testsuite/tests/diagnostic-codes/Makefile 6 additions, 0 deletionstestsuite/tests/diagnostic-codes/Makefile
- testsuite/tests/diagnostic-codes/all.T 12 additions, 0 deletionstestsuite/tests/diagnostic-codes/all.T
Loading
Please register or sign in to comment