This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Weird bug for default constructor


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]