logo       

[ ghc-Bugs-1039993 ] ghc --make + hi-boot + class declarations = trouble: msg#00008

lang.haskell.glasgow.bugs

Subject: [ ghc-Bugs-1039993 ] ghc --make + hi-boot + class declarations = trouble

Bugs item #1039993, was opened at 2004-10-04 10:41
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1039993&group_id=8032

Category: Compiler
Group: 6.2.1
Status: Open
Resolution: None
Priority: 5
Submitted By: Jon Cast (jcast)
Assigned to: Nobody/Anonymous (nobody)
Summary: ghc --make + hi-boot + class declarations = trouble

Initial Comment:
Consider the following test case:

-- Main.hs --
module Main where

import Module1
import Module2

main = return ()

-- Module1.hs --
module Module1 where

import Module2

class Three alpha where
three :: Kappa alpha -> Kappa alpha -> Kappa alpha

-- Module1.hi-boot --
module Module2 where

import {-# SOURCE #-} Module1

data Kappa alpha = Kappa alpha alpha

f :: Three alpha => Kappa alpha -> alpha
f k = case three k k of
Kappa x y -> x

-- Module1.hi-boot --
module Module1 where

class Three alpha where
three :: Module2.Kappa alpha -> Module2.Kappa alpha
-> Module2.Kappa alpha

-- Compilation Results --
cd /home/jcast/Source/tmp/ # -*-compilation-*-
Entering directory `/home/jcast/Source/tmp/'
ghc --make Main
Chasing modules from: Main
Compiling Module2 ( ./Module2.hs, ./Module2.o )

./Module2.hs:1:
Failed to find interface decl for `Module1.$dmthree'
from module `Module1'

Compilation exited abnormally with code 1 at Mon Oct 4
09:38:50

No, for the real program it's not strictly necessary to
employ mutual recursion between the modules in
question---but it is by far the most natural design.

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=1039993&group_id=8032


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise