GNOME Bugzilla – Bug 539892
incomplete type error:
Last modified: 2009-01-16 22:32:44 UTC
Please describe the problem: In the generated code, nested structs or classes are only fully defined AFTER the containing class. A preliminary declaration is generated before: typedef struct _PhoneUIGladewindow_widgets PhoneUIGladewindow_widgets; so for classes, which are implemented as pointers, this is not fatal. But for nested structs, the generated C code fails to compile with "incomplete type error" Steps to reproduce: Compile this code: ---- using GLib; using Gtk; using Glade; public class PhoneUIGlade : Gtk.Object { protected Glade.XML xml; protected struct window_widgets { protected Gtk.Widget blah; protected Gtk.Widget blah2; } protected window_widgets widgets; } ---- like this: valac --pkg gtk+-2.0 --pkg libglade-2.0 --pkg gmodule-2.0 --basedir . FILE.vala and observe the error. Compile like this to look in the generated header file: valac -C --pkg gtk+-2.0 --pkg libglade-2.0 --pkg gmodule-2.0 --basedir . FILE.vala Actual results: Compilation fails Expected results: Success, with the struct definition occuring before the class which holds it. Does this happen every time? every darn toonin' time Other information:
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. *** This bug has been marked as a duplicate of 471244 ***