#5445: programatica package compilation fails
---------------------------------+------------------------------------------
    Reporter:  maeder            |        Owner:  simonpj                  
        Type:  bug               |       Status:  new                      
    Priority:  normal            |    Milestone:                           
   Component:  Compiler          |      Version:  7.2.1                    
    Keywords:                    |     Testcase:                           
   Blockedby:                    |   Difficulty:                           
          Os:  Unknown/Multiple  |     Blocking:                           
Architecture:  Unknown/Multiple  |      Failure:  GHC rejects valid program
---------------------------------+------------------------------------------

Comment(by simonpj@…):

 commit faadd61ef05e8f84a2ad7e0fb6b6d873a7b8c232
 {{{
 Author: Simon Peyton Jones <[email protected]>
 Date:   Fri Sep 2 09:20:45 2011 +0100

     Two bugs in rnExports (fixes Trac #5445)

     When constructing export lists, data families pose an awkward problem,
     documented in Note [Exports of data families] in RnNames.  Consider

            module M where
                  import X( D )
                  data instance D Int = M1 | M2

     Here M exports M1 and M2, obviously, but does it export D?  It would
     not usually do so, but if we don't then no one can import M
 selectively
     like this:
                import M( D(M1,M2) )

     So we compromise and export D too.  But I made two mistakes

     a) Didn't check for conflicts between the extra export of X.D
        and any other exports called "D"

     b) Did the extra export for imported things too, not just ones defined
        in this module (ie made the compromise apply much more widely than
        necessary)

     This made Programatica (a complex project) break in an obscure
     way; (b) caused an export conflict, (a) meant that the conflict
     was not spotted, which in turn caused later chaos.

     Anyway the fix is easy, and is documented in the Note.

  compiler/rename/RnNames.lhs |   73
 ++++++++++++++++++++++++++----------------
  1 files changed, 45 insertions(+), 28 deletions(-)
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5445#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to