Vladislav Zavialov pushed to branch wip/int-index/mod-export-tests at Glasgow Haskell Compiler / GHC
Commits:
-
169bcac8
by Vladislav Zavialov at 2025-10-28T17:39:45+03:00
8 changed files:
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- testsuite/tests/diagnostic-codes/codes.stdout
- + testsuite/tests/warnings/should_compile/DuplicateModExport.hs
- + testsuite/tests/warnings/should_compile/DuplicateModExport.stderr
- + testsuite/tests/warnings/should_compile/EmptyModExport.hs
- + testsuite/tests/warnings/should_compile/EmptyModExport.stderr
- testsuite/tests/warnings/should_compile/all.T
Changes:
| ... | ... | @@ -619,7 +619,7 @@ instance Diagnostic TcRnMessage where |
| 619 | 619 | TcRnDupeModuleExport mod
|
| 620 | 620 | -> mkSimpleDecorated $
|
| 621 | 621 | hsep [ text "Duplicate"
|
| 622 | - , quotes (text "Module" <+> ppr mod)
|
|
| 622 | + , quotes (text "module" <+> ppr mod)
|
|
| 623 | 623 | , text "in export list" ]
|
| 624 | 624 | TcRnExportedModNotImported mod
|
| 625 | 625 | -> mkSimpleDecorated
|
| ... | ... | @@ -1567,10 +1567,11 @@ data TcRnMessage where |
| 1567 | 1567 | occurs when a module appears more than once in an export list.
|
| 1568 | 1568 | |
| 1569 | 1569 | Example(s):
|
| 1570 | - module Foo (module Bar, module Bar)
|
|
| 1571 | - import Bar
|
|
| 1570 | + module Foo (module Bar, module Bar) where
|
|
| 1571 | + import Bar
|
|
| 1572 | 1572 | |
| 1573 | - Text cases: None
|
|
| 1573 | + Text cases:
|
|
| 1574 | + DuplicateModExport
|
|
| 1574 | 1575 | -}
|
| 1575 | 1576 | TcRnDupeModuleExport :: ModuleName -> TcRnMessage
|
| 1576 | 1577 | |
| ... | ... | @@ -1590,10 +1591,11 @@ data TcRnMessage where |
| 1590 | 1591 | when an export list contains a module that has no exports.
|
| 1591 | 1592 | |
| 1592 | 1593 | Example(s):
|
| 1593 | - module Foo (module Bar) where
|
|
| 1594 | - import Bar ()
|
|
| 1594 | + module Foo (module Bar) where
|
|
| 1595 | + import Bar ()
|
|
| 1595 | 1596 | |
| 1596 | - Test cases: None
|
|
| 1597 | + Test cases:
|
|
| 1598 | + EmptyModExport
|
|
| 1597 | 1599 | -}
|
| 1598 | 1600 | TcRnNullExportedModule :: ModuleName -> TcRnMessage
|
| 1599 | 1601 |
| ... | ... | @@ -50,8 +50,6 @@ |
| 50 | 50 | [GHC-17268] is untested (constructor = TcRnCharLiteralOutOfRange)
|
| 51 | 51 | [GHC-36495] is untested (constructor = TcRnTagToEnumMissingValArg)
|
| 52 | 52 | [GHC-55868] is untested (constructor = TcRnArrowIfThenElsePredDependsOnResultTy)
|
| 53 | -[GHC-51876] is untested (constructor = TcRnDupeModuleExport)
|
|
| 54 | -[GHC-64649] is untested (constructor = TcRnNullExportedModule)
|
|
| 55 | 53 | [GHC-94558] is untested (constructor = TcRnExportHiddenComponents)
|
| 56 | 54 | [GHC-63055] is untested (constructor = TcRnFieldUpdateInvalidType)
|
| 57 | 55 | [GHC-26133] is untested (constructor = TcRnForeignImportPrimSafeAnn)
|
| 1 | +module DuplicateModExport (module L, module L) where
|
|
| 2 | + |
|
| 3 | +import Data.List as L |
| 1 | +DuplicateModExport.hs:1:38: warning: [GHC-51876] [-Wduplicate-exports (in -Wdefault)]
|
|
| 2 | + Duplicate ‘module L’ in export list
|
|
| 3 | + |
| 1 | +module EmptyModExport (module L) where
|
|
| 2 | + |
|
| 3 | +import Data.List as L () |
| 1 | +EmptyModExport.hs:1:24: warning: [GHC-64649] [-Wdodgy-exports (in -Wextra)]
|
|
| 2 | + The export item ‘module L’ exports nothing
|
|
| 3 | + |
| ... | ... | @@ -72,3 +72,5 @@ test('T23465', normal, compile, ['-ddump-parsed']) |
| 72 | 72 | test('WarnNoncanonical', normal, compile, [''])
|
| 73 | 73 | test('T24396', [extra_files(["T24396a.hs", "T24396b.hs"])], multimod_compile, ['T24396b', ''])
|
| 74 | 74 | test('SpecMultipleTys', normal, compile, ['']) # compile_fail from GHC 9.18
|
| 75 | +test('DuplicateModExport', normal, compile, ['-Wduplicate-exports'])
|
|
| 76 | +test('EmptyModExport', normal, compile, ['-Wdodgy-exports']) |