#3823: GHC 6.12 breaks combination of records and mutually recursive modules
---------------------------------+------------------------------------------
Reporter: mboes | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 6.12.1 | Keywords:
Os: Unknown/Multiple | Testcase:
Architecture: Unknown/Multiple | Failure: GHC rejects valid program
---------------------------------+------------------------------------------
Take the following code for two mutually recursive modules A and B:
{{{
module A where
import B
data A = X { x :: Bool } | Y
y :: A -> A
y = \_ -> Y
-- A.hs-boot
module A where
data A = X { x :: Bool } | Y
y :: A -> A
module B where
import {-# SOURCE #-} A
data B = A A
a = x (X True)
b = y a
}}}
Compiling this code with ghc --make or ghci gives:
{{{
[1 of 3] Compiling A[boot] ( A.hs-boot, A.o-boot )
[2 of 3] Compiling B ( B.hs, B.o )
B.hs:7:4:
Can't find interface-file declaration for variable x
Probable cause: bug in .hi-boot file, or inconsistent .hi file
Use -ddump-if-trace to get an idea of which file caused the error
In the expression: x (X True)
In the definition of `a': a = x (X True)
}}}
This code used to work in GHC 6.10.
Note that this issue breaks the build of the hmk package on Hackage.
Doubtless other packages making use of mutually recursive modules hit this
snag too.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3823>
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