[cvs-nhc98] cvs commit: nhc98/src/prelude/FFI CTypes.h CTypes.hs CTypesExtra.hs

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Fri Jun 18 18:54:08 EDT 2004


> > >      Cannot find constructor for newtype: InfoData 92 NHC.FFI.CPtrdiff IEnone 92 (DataNewType False [])
> > 
> >     Cannot find constructor for newtype: InfoData 77 NHC.FFI.CInt IEnone 77 (DataNewType False [])
> 
> If it still doesn't work, then it is possible that your application
> code is importing, re-exporting, then re-importing CPtrdiff() and
> CInt() abstract, i.e. without their constructors.  That can confuse
> nhc98, which needs the definition info to appear in the interface
> file, in order to determine what the real underlying type is.  This is
> probably a bug, but one that is not easy to fix without introducing
> other bugs.  The workaround is to mention the constructors on
> import/export, viz, CInt(..).

OK, I think I have fixed this bug.  It should now be possible to
export a newtype abstractly, and the real underlying type will still
be visible to the importing module, so the FFI can use it.  Sven,
would you like to revert some of the workarounds you introduced in
libraries recently, to see if it really works now?

Regards,
    Malcolm


More information about the Cvs-nhc98 mailing list