Bug: instances from non-imported files used
5 Jun
2006
5 Jun
'06
1:29 a.m.
Hi, With the following setup: -- module A where data A = A -- module B where import A b = show A -- module C where import A instance Show A where show A = "A" -- import B import C main = print "hello" -- :load B fails, complaining that there is no Show instance for A, which is correct. However, :load Main succeeds, even though the module B that it imports is valid. It seems that the show instance of C is used in B, even though the module B does not import (even transitively) C. GHC fails with: ./B.hs:6:4: No instance for (Show A) arising from use of `show' at ./B.hs:6:4-7 Probable fix: add an instance declaration for (Show A) In the definition of `b': b = show A Using Hugs May 2006 on Windows. Thanks Neil
7348
Age (days ago)
7348
Last active (days ago)
0 comments
1 participants
participants (1)
-
Neil Mitchell