Ticket #4240 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

-ddump-minimal-imports vs. re-exported class methods

Reported by: nomeata Owned by:
Priority: normal Milestone: 7.0.1
Component: Compiler Version: 6.12.3
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty:
Test Case: rename/should_compile/T4240 Blocked By:
Blocking: Related Tickets:

Description

Please excuse me reporting a bug without testing it with the latest released version, but I only have easy access to 6.12.1 now.

The following working import line:

import Darcs.Patch

is turned by ghc -ddump-minimal-imports into

import Darcs.Patch
    ( Invert(invert), FromPrims(fromPrims), namepatch )

which does not work:

$ ghc -ddump-minimal-imports --make ipatch.hs
[2 of 8] Compiling Common           ( Common.hs, Common.o )

Common.hs:20:6:
    Module `Darcs.Patch' does not export `Invert(invert)'

Common.hs:20:22:
    Module `Darcs.Patch' does not export `FromPrims(fromPrims)'

The line

import Darcs.Patch ( invert, fromPrims, namepatch )

works though.

The reason seems to be this chain of imports (shortend of course):

module Darcs.Patch.Patchy ( Invert(..) ) where
class MyEq p => Invert p where
    invert :: p C(x y) -> p C(y x)

is re-exported without the Class name by

module Darcs.Patch ( invert ) where
import Darcs.Patch.Patchy ( invert )
}}}.

Change History

Changed 3 years ago by igloo

  • testcase set to T4240
  • milestone set to 6.14.1

Thanks for the report.

Changed 3 years ago by simonpj

  • status changed from new to closed
  • testcase changed from T4240 to rename/should_compile/T4240
  • resolution set to fixed

Great. Fixed by this patch, which also fixed a separate lurking bug

Wed Sep 15 13:19:37 BST 2010  simonpj@microsoft.com
  * Fix Trac #4240: -ddump-minimal-imports
  
  See Note [Partial export] for the details.
  I also fixed one egregious bug that was just
  waiting to bite: we were using loadSysInterface
  instead of loadSrcInterface.

    M ./compiler/rename/RnNames.lhs -48 +83

Simon

Note: See TracTickets for help on using tickets.