[GHC] #10336: Support qualified self {-# SOURCE #-} import

GHC ghc-devs at haskell.org
Tue Apr 21 13:02:45 UTC 2015


#10336: Support qualified self {-# SOURCE #-} import
-------------------------------------+-------------------------------------
              Reporter:  ezyang      |             Owner:
                  Type:  feature     |            Status:  new
  request                            |         Milestone:  ⊥
              Priority:  lowest      |           Version:  7.11
             Component:  Compiler    |  Operating System:  Unknown/Multiple
              Keywords:              |   Type of failure:  GHC rejects
          Architecture:              |  valid program
  Unknown/Multiple                   |        Blocked By:  7672
             Test Case:              |   Related Tickets:
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
 The source import in this module is a no-op and has no legitimate use:

 {{{
 module A where
 import {-# SOURCE #-} A
 }}}

 It's also tricky to support properly, see #10182. So we will disable it.

 However, there is one mode of use which cannot be legitimately done in
 normal Haskell: a qualified source import:

 {{{
 module A where
 import {-# SOURCE #-} qualified A as MyA
 }}}

 The intended semantics is that the boot entities defined in A.hs-boot are
 available under the qualification MyA.

 Fixing #7672 would get us most of the way here, but there is one more step
 to avoid regressing #10182. So this just seems not worth fixing, unless
 someone really wants it.

 (Note: regular self imports could also be supported this way, but it would
 be even more complicated to do, since we don't even know what OccNames to
 add provenances for.)

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10336>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list