Regression in a warning of an unused import in a GADT

Alain Cremieux alcremi at pobox.com
Tue Jan 24 16:36:34 EST 2006


Hi,
The following program incorrectly produces a warning about an unused 
import :

module Bug ( Structure (..) ) where

import Data.Ratio ( Rational )

data Structure a where
   StructCons  :: Int   -> Structure Int
   StructRatio ::          Structure Rational


produces:


Bug.hs:3:0:
    Warning: Module `Data.Ratio' is imported, but nothing from it is used,
               except perhaps instances visible in `Data.Ratio'
             To suppress this warning, use: import Data.Ratio()

Bug.hs:3:20:
    Warning: Imported from `Data.Ratio' but not used:
               type constructor or class `Rational'


with ghc checked-out from the HEAD 4 days ago (but the problem has been 
present for quite some time).

ghc-6.4.1, rightly, does not produce any message.

Of course the problem exists with any import, not just Rational.

Alain



More information about the Cvs-ghc mailing list