Skip to content
Snippets Groups Projects
Forked from Glasgow Haskell Compiler / GHC
Source project has a limited visibility.
  • sheaf's avatar
    0ef1d8ae
    Compute all emitted diagnostic codes · 0ef1d8ae
    sheaf authored and Marge Bot's avatar Marge Bot committed
    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).
    0ef1d8ae
    History
    Compute all emitted diagnostic codes
    sheaf authored and Marge Bot's avatar Marge Bot committed
    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).
Code owners
Assign users and groups as approvers for specific file changes. Learn more.