Opened 9 years ago

Closed 8 years ago

#3082 closed feature request (fixed)

Unclear warning message: Attempting to re-export hidden constructors

Reported by: ksf Owned by:
Priority: normal Milestone: 6.12.1
Component: Compiler Version: 6.10.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Just stumbled upon this after changing a type def to a data def:

Foo.hs:

module Foo (Foo) where

data Foo = Bar | Baz

Bar.hs:

module Bar (Foo.Foo(..)) where

import Foo
Bar.hs:1:12:
    Warning: The export item `Foo(..)'
             suggests that `Foo' has constructors or class methods,
             but it has none

...while it actually has constructors.

I think it should say "The export item 'Foo(..)' suggests that 'Foo' has visible constructors or class methods, but it has none", or something even more specific to the re-export case.

Change History (5)

comment:1 Changed 9 years ago by simonpj

difficulty: Unknown

Good point. How about this?

Warning: The export item `Foo(..)' suggests that 
         `Foo' has (in-scope) constructors or class methods,
         but it has none

Note the extra (in-scope).

Simon

comment:2 Changed 9 years ago by ksf

Looks fine... to be honest, I don't care about the wording.

Another possibility is discerning between the no-constructors and the reexport case, that is,

Warning: The export item `Foo(..)' suggests that `Foo''s constuctors /
         class methods are being exported from this package, but they are
         hidden by the export item `Foo' in Bar.hs:12

in addition to the current warning.

I doubt it's worth the bother, though.

comment:3 Changed 9 years ago by igloo

Milestone: 6.12.1

comment:4 Changed 8 years ago by ross

Type: proposalfeature request

comment:5 Changed 8 years ago by igloo

Resolution: fixed
Status: newclosed

It looks like Simon's original fix has fixed the problem sufficiently, so I'm closing this ticket.

Note: See TracTickets for help on using tickets.