#5147: GHCi ignores missing instance
---------------------------------+------------------------------------------
Reporter: boris | Owner:
Type: bug | Status: new
Priority: normal | Component: GHCi
Version: 7.0.2 | Keywords: linker, data families
Testcase: | Blockedby:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: GHC accepts invalid program
---------------------------------+------------------------------------------
GHCi loads modules M1 and M2. Then when Show instance in M1 is removed,
reloading does not complain about the missing instance which is referred
by function showField in M2. When I run any computation involving
showField, for example, "const () showField", GHCi fails with the
following error:
{{{
During interactive linking, GHCi couldn't find the following symbol:
M1_zdfShowFields_closure
This may be due to you not asking GHCi to load extra object files,
archives or DLLs needed by your current session. Restart GHCi, specifying
the missing library using the -L/path/to/object/dir and -lmissinglibname
flags, or simply by naming the relevant files on the GHCi command line.
Alternatively, this link failure might indicate a bug in GHCi.
If you suspect the latter, please send a bug report to:
[email protected]
}}}
If I replace data family declaration in a class with a standalone data
family, GHCi displays the correct error about the missing instance.
Files:
{{{
{-# LANGUAGE TypeFamilies #-}
module M1 where
class Entity v where
data Fields v
instance Show (Fields v) where show = undefined
}}}
{{{
module M2 where
import M1
showField :: Fields v -> String
showField a = show a
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5147>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs