module-implements

Per Bothner per@bothner.com
Tue Sep 14 03:59:00 GMT 2010


On 09/13/2010 11:06 AM, Jamison Hope wrote:
> Hey Per, am I missing something, or does module-implements not work?
> ...
> Regardless of where in the file I put the "(module-implements
> java.awt.event.ActionListener)" line, the resultant class only ever
> implements java.lang.Runnable.

Indeed.  This is an issue of compiler needing some information
before it is set/calculated.  A general problem whenever forward
references are allowed.  It's not clear what is the "right" solution,
but I notice that on 2008-12-23 I made a change for module-extends,
and so the logical change would be to do the same for module-implements.

The attached patch should work.

> Also, the documentation says that if there is a module-implements
> declaration, then (module-static #f) is implied.
> But if I remove the explicit "(module-static #f)" and recompile, then
> actionPerformed() and action$Mnperformed are static:

That seems to be fixed with the attached patch.

> I don't see any test cases in trunk/testsuite, so I imagine
> module-implements has never left the experimental stage.

No, I believe it actually working at one point, but whatever
change necessitated the 2008-12-23 change for module-extends
probably also broke module-implements, and
it wasn't caught because of a missing test-case.  I'd like to
add a test-case before I check the fix in.
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: impl.patch
URL: <http://sourceware.org/pipermail/kawa/attachments/20100914/ce67260d/attachment.ksh>


More information about the Kawa mailing list