[cvs-nhc98] patch applied (hat): Correct bug in handling of imports.
Malcolm Wallace
Malcolm.Wallace at cs.york.ac.uk
Tue Oct 10 07:24:43 EDT 2006
Wed Apr 23 11:21:30 PDT 2003 olaf
* Correct bug in handling of imports.
Hat-trans has to add an "import qualified PreludeBasic" to any transformed module (except the Prelude modules), because some of these identifiers are used in transformed code, in particular in derived instances.
This import is now only added as a last step before pretty-printing. Before it was done before the reading of interface files. As a result the PreludeBasic.hx file was always processed neadlessly and because the renaming phase does not complain if an identifier of a qualified import is referred to unqualified, we also imported unwanted identifiers. In a recent bug report Stephen Pitts complained that the transformed Edison library does not compile. Basically it contains
import Prelude hiding (reverse)
class Sequence s where
reverse :: s a -> s a
and unfortunately the superfluous import of PreludeBasic caused hat-trans to consider reverse as the reverse from PreludeBasic. So reverse was annotated as being of arity 0, leading to later problems.
This bug fix fixes the Edison example. It does not quite solve the whole problem, because Haskell does not require the hiding of reverse. But I believe it solves all realistic examples.
M ./src/hattrans/HatTrans.hs -12 +23
More information about the Cvs-nhc98
mailing list