Namespacing for WARNING/DEPRECATED pragmas (#24396)
New syntax for WARNING and DEPRECATED pragmas was added, namely namespace specifierss: namespace_spec ::= 'type' | 'data' | {- empty -} warning ::= warning_category namespace_spec namelist strings deprecation ::= namespace_spec namelist strings A new data type was introduced to represent these namespace specifiers: data NamespaceSpecifier = NoSpecifier | TypeNamespaceSpecifier (EpToken "type") | DataNamespaceSpecifier (EpToken "data") Extension field XWarning now contains this NamespaceSpecifier. lookupBindGroupOcc function was changed: it now takes NamespaceSpecifier and checks that the namespace of the found names matches the passed flag. With this change {-# WARNING data D "..." #-} pragma will only affect value namespace and {-# WARNING type D "..." #-} will only affect type namespace. The same logic is applicable to DEPRECATED pragmas. Finding duplicated warnings inside rnSrcWarnDecls now takes into consideration NamespaceSpecifier flag to allow warnings with the same names that refer to different namespaces.
Showing
- compiler/GHC/Hs/Decls.hs 27 additions, 4 deletionscompiler/GHC/Hs/Decls.hs
- compiler/GHC/Parser.y 12 additions, 7 deletionscompiler/GHC/Parser.y
- compiler/GHC/Rename/Bind.hs 1 addition, 1 deletioncompiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/Env.hs 15 additions, 11 deletionscompiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Module.hs 10 additions, 8 deletionscompiler/GHC/Rename/Module.hs
- docs/users_guide/9.10.1-notes.rst 12 additions, 0 deletionsdocs/users_guide/9.10.1-notes.rst
- docs/users_guide/exts/pragmas.rst 18 additions, 2 deletionsdocs/users_guide/exts/pragmas.rst
- libraries/ghc-prim/GHC/Tuple.hs 1 addition, 1 deletionlibraries/ghc-prim/GHC/Tuple.hs
- testsuite/tests/warnings/should_compile/T24396.stderr 68 additions, 0 deletionstestsuite/tests/warnings/should_compile/T24396.stderr
- testsuite/tests/warnings/should_compile/T24396a.hs 31 additions, 0 deletionstestsuite/tests/warnings/should_compile/T24396a.hs
- testsuite/tests/warnings/should_compile/T24396b.hs 27 additions, 0 deletionstestsuite/tests/warnings/should_compile/T24396b.hs
- testsuite/tests/warnings/should_compile/all.T 1 addition, 0 deletionstestsuite/tests/warnings/should_compile/all.T
- utils/check-exact/ExactPrint.hs 18 additions, 6 deletionsutils/check-exact/ExactPrint.hs
Loading
Please register or sign in to comment