Fix checkHiBootIface for instances declared in hs-boot files
authorsimonpj@microsoft.com <unknown>
Wed, 21 Mar 2007 14:04:24 +0000 (14:04 +0000)
committersimonpj@microsoft.com <unknown>
Wed, 21 Mar 2007 14:04:24 +0000 (14:04 +0000)
commit9ac57e65bb77638ff7d5e7148ee5c3d80b25cf7d
treef7668f406d6b993dbf7aecf8a1f406f02e54ddad
parent79adecdb64e642f507e5113757ca69bc64df6bdc
Fix checkHiBootIface for instances declared in hs-boot files

Hs-boot files can contain instance declarations, but Duncan used this feature
for the first time today, and it didn't quite work.  I'm not sure whether
it worked before; anyway it does now.

The point is that the hs-boot file advertises an instance for, say, Num Int,
with the arbitrary name $fx1.  The main module declares Num Int, and gives
it the name, say, $f3.  So we need to generate a declaration
$fx1 = $f3
to make it all line up.  And (this is the bit that was wrong) we need
to make that new binding visible to imported unfoldings that mention
$fx1.
compiler/typecheck/TcRnDriver.lhs