RE: GHC confused by hi-boot files

2004-10-01 Thread Simon Peyton-Jones
Great bug!  This has been lurking quite a while.

You'll be happy to hear that I've taken the opportunity to tidy up
hi-boot handling quite
a bit.  In particular, as well as fixing this bug, I've also implemented
hi-boot file consistency
checking.  When compiling M.hs, GHC will complain if M.hi-boot is
inconsistent with it.

All this is in the HEAD.  It's much too much to transfer to 6.2.2.  If
the bug below is a really major problem I might be able to hack up a
fix, but I'd rather not.  Just use a data type instead.

Thanks for boiling this down into a nice small case. It saves a lot of
time.

Simon

| -Original Message-
| From: [EMAIL PROTECTED]
[mailto:glasgow-haskell-bugs-
| [EMAIL PROTECTED] On Behalf Of George Russell
| Sent: 17 September 2004 10:31
| To: [EMAIL PROTECTED]
| Subject: GHC confused by hi-boot files
| 
| With both ghc6.2 and 6.2.20040915 on Linux, ghc --make cannot compile
| the attached files and produces a confusing error message.
| 
|   # ghc --make View.hs
| Chasing modules from: View.hs
| Compiling ViewType ( ./ViewType.hs, ./ViewType.o )
| Compiling VersionGraphClient ( ./VersionGraphClient.hs,
./VersionGraphClient.o )Compiling View
| ( View.hs, View.o )
| 
| View.hs:14:
|  Couldn't match `VersionGraphClient' against `VersionGraphClient'
|   Expected type: VersionGraphClient
|   Inferred type: VersionGraphClient
|  In the `graphClient1' field of a record
|  In the record construction: View {graphClient1 = graphClient}
| 
| However ghc without make has no problems.
| 
| # ghc -c ViewType.hs
| # ghc -c VersionGraphClient.hs
| # ghc -c View.hs
| 
| best wishes to all Simons!
| 
| 

___
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


GHC confused by hi-boot files

2004-09-17 Thread George Russell
With both ghc6.2 and 6.2.20040915 on Linux, ghc --make cannot compile
the attached files and produces a confusing error message.
 # ghc --make View.hs
Chasing modules from: View.hs
Compiling ViewType ( ./ViewType.hs, ./ViewType.o )
Compiling VersionGraphClient ( ./VersionGraphClient.hs, ./VersionGraphClient.o 
)Compiling View ( View.hs, View.o )
View.hs:14:
Couldn't match `VersionGraphClient' against `VersionGraphClient'
Expected type: VersionGraphClient
Inferred type: VersionGraphClient
In the `graphClient1' field of a record
In the record construction: View {graphClient1 = graphClient}
However ghc without make has no problems.
# ghc -c ViewType.hs
# ghc -c VersionGraphClient.hs
# ghc -c View.hs
best wishes to all Simons!

module VersionGraphClient where

data VersionGraphClient
module VersionGraphClient(
   VersionGraphClient,

   ) where

import ViewType

newtype VersionGraphClient = VersionGraphClient Int
-- | This module defines the fundamental structure of the (untyped) 
-- objects in a repository. 
-- 
-- We depend circularly on CodedValue.hs.  This module is compiled
-- first and uses CodedValue.hi-boot.
module View(
   ) where

import ViewType
import VersionGraphClient

createView :: VersionGraphClient - IO View
createView graphClient =
   do
  return (View {
 graphClient1 = graphClient
 })
module ViewType(

   View(..),
   ) where


import {-# SOURCE #-} VersionGraphClient

data View = View {
   graphClient1 :: VersionGraphClient
   }

___
Glasgow-haskell-bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs