[nhc-bugs] import/export bug

Ian Lynagh igloo at earth.li
Wed Oct 22 15:08:00 EDT 2003


OK, with the following modules:

-----
module Bar (Bar(..)) where

data Bar = CBar | CBaz deriving Show
-----

-----
module Baz (Bar(..)) where

data Bar = CBar | CBaz deriving Show
-----

-----
module Foo (Bar(CBar,CBaz)) where

import qualified Bar
import Bar hiding (Bar(..))
import Baz
-----

nhc98 gives bogus errors:

$ nhc98     -c  -o Baz.o Baz.hs
$ nhc98     -c  -o Bar.o Bar.hs
$ nhc98     -c  -o Foo.o Foo.hs
======  Errors when renaming:
Constructor CBaz defined 2 times.
Constructor CBar defined 2 times.
$ 

hugs and ghc6 are happy. As a workaround I've found changing Foo's
import of Bar to

import Bar hiding (Bar(CBar,CBaz))

fixes it.


Thanks
Ian



More information about the Nhc-bugs mailing list