This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Weird bug for default constructor
- From: Per Bothner <per at bothner dot com>
- To: Kjetil Svalastog Matheussen <k dot s dot matheussen at notam02 dot no>
- Cc: kawa at sources dot redhat dot com
- Date: Thu, 08 Feb 2007 17:52:12 -0800
- Subject: Re: Weird bug for default constructor
- References: <Pine.LNX.4.64.0702082037480.7178@iannis.localdomain>
Kjetil Svalastog Matheussen wrote:
Hi,
When compiling the code below with "kawa -C c_image.scm" I get the
following error:
[kjetism@iannis src]$ kawa -C bug.scm
I checked in a fix for this.
I can not guarantee that you are able to reproduce it, because it seems
to be rather random when the internal error strikes or not. But I hope
that this example is reproducable...
The bug happens when the class needed to refer to a non-static
component of the surrounding module, but the init method did not
do so itself. However, in that case the init method still needs
an implicit static link parameter, so the class's static-link ("this$0")
field can be initialized.
I won't be surprised if its related to the garbage collector either,
since I had so much trouble making a reproducable example.
Nope.
Or, perhaps I have just screwed up something. Hopefully someone tells me
if I have done something obviously stupid.
Nope.
Also, is there any "super" kind of function available? Because then
I can get away with only one constructor. (<c_image> is a superclass)
http://www.gnu.org/software/kawa/Defining-new-classes.html discusses
this. Basically, you need to use invoke-special.
--
--Per Bothner
per@bothner.com http://per.bothner.com/