After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 539892 - incomplete type error:
incomplete type error:
Status: RESOLVED DUPLICATE of bug 471244
Product: vala
Classification: Core
Component: Code Generator
0.3.x
Other All
: Normal normal
: ---
Assigned To: Jürg Billeter
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2008-06-24 08:17 UTC by sam
Modified: 2009-01-16 22:32 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description sam 2008-06-24 08:17:26 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:
Comment 1 Jürg Billeter 2009-01-16 22:32:44 UTC
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 ***