Alan Zimmerman pushed to branch wip/az/T27291-namespace-specified-wildcards at Glasgow Haskell Compiler / GHC

Commits:

4 changed files:

Changes:

  • testsuite/tests/printer/Makefile
    ... ... @@ -907,6 +907,11 @@ Test25885:
    907 907
     	$(CHECK_PPR)   $(LIBDIR) Test25885.hs
    
    908 908
     	$(CHECK_EXACT) $(LIBDIR) Test25885.hs
    
    909 909
     
    
    910
    +.PHONY: Test27291
    
    911
    +Test27291:
    
    912
    +	$(CHECK_PPR)   $(LIBDIR) Test27291.hs
    
    913
    +	$(CHECK_EXACT) $(LIBDIR) Test27291.hs
    
    914
    +
    
    910 915
     .PHONY: TestLevelImports
    
    911 916
     TestLevelImports:
    
    912 917
     	$(CHECK_PPR)   $(LIBDIR) TestLevelImports.hs
    

  • testsuite/tests/printer/Test27291.hs
    1
    +{-# LANGUAGE ExplicitNamespaces #-}
    
    2
    +
    
    3
    +module Test27291
    
    4
    +    ( C(type ..)       -- exports class C and data family D
    
    5
    +    , C(data ..)       -- exports class C and method m
    
    6
    +    , D(type ..)       -- exports data family D
    
    7
    +    , type T (..)      -- exports type T and all its data constructors D, D2
    
    8
    +    , type T (type ..) -- exports type T
    
    9
    +    , type K (type ..) -- exports type K and its constructor K1
    
    10
    +    ) where
    
    11
    +
    
    12
    +import Control.Applicative qualified as A (type Applicative (data ..))
    
    13
    +import Data.Either qualified as E (type Either (data ..))
    
    14
    +
    
    15
    +import Data.Bool (data True (..))
    
    16
    +import Data.Bool (data True( data .. ) )
    
    17
    +import Data.Bool (data True( type ..))
    
    18
    +
    
    19
    +import DodgyImports03_helper (C(  .. ))
    
    20
    +import DodgyImports03_helper (C  (data .. ))
    
    21
    +import DodgyImports03_helper (C(  type ..) )
    
    22
    +
    
    23
    +import DodgyImports03_helper (T ( .. ) )
    
    24
    +import DodgyImports03_helper (T(data ..))
    
    25
    +import DodgyImports03_helper (T(type ..))
    
    26
    +
    
    27
    +import Control.Applicative (type Applicative (type ..))  -- dodgy: no associated types
    
    28
    +import Data.Either (type Either (type ..))               -- dodgy: not a class
    
    29
    +
    
    30
    +import Data.Proxy (type Proxy(data ..))                  -- ok
    
    31
    +import Data.Proxy (type Proxy(type ..))                  -- dodgy: not a class
    
    32
    +
    
    33
    +import T25901_sub_g_helper qualified as T1 (T (data ..)) -- T and MkT
    
    34
    +import T25901_sub_g_helper qualified as T2 (T (type ..)) -- T only
    
    35
    +import T25901_sub_g_helper qualified as T3 (type T (..)) -- T and MkT

  • testsuite/tests/printer/all.T
    ... ... @@ -217,6 +217,7 @@ test('T24237', normal, compile_fail, [''])
    217 217
     
    
    218 218
     test('Test25454', [ignore_stderr, req_ppr_deps], makefile_test, ['Test25454'])
    
    219 219
     test('Test25885', [ignore_stderr, req_ppr_deps], makefile_test, ['Test25885'])
    
    220
    +test('Test27291', [ignore_stderr, req_ppr_deps], makefile_test, ['Test27291'])
    
    220 221
     
    
    221 222
     test('TestLevelImports', [ignore_stderr, req_ppr_deps], makefile_test, ['TestLevelImports'])
    
    222 223
     test('TestNamedDefaults', [ignore_stderr, req_ppr_deps], makefile_test, ['TestNamedDefaults'])
    

  • utils/check-exact/ExactPrint.hs
    ... ... @@ -4581,9 +4581,9 @@ instance ExactPrint (IE GhcPs) where
    4581 4581
         return (IEThingAbs depr' thing' doc')
    
    4582 4582
       exact (IEThingAll x ns_spec thing doc) = do
    
    4583 4583
         depr' <- markAnnotated (ieta_warning x)
    
    4584
    -    ns_spec' <- markAnnotated ns_spec
    
    4585 4584
         thing' <- markAnnotated thing
    
    4586 4585
         op' <- markEpToken (ieta_tok_lpar x)
    
    4586
    +    ns_spec' <- markAnnotated ns_spec
    
    4587 4587
         dd' <- markEpToken (ieta_tok_wc x)
    
    4588 4588
         cp' <- markEpToken (ieta_tok_rpar x)
    
    4589 4589
         doc' <- markAnnotated doc