[Vala] incomplete type error:



Do I need to file a bug for this or have I got it wrong?

This fails:
valac --pkg gtk+-2.0 --pkg libglade-2.0 --pkg gmodule-2.0 --basedir . 
src/phoneui.glade.vala
/home/sam/projects/vala/phoneui/src/phoneui.glade.h:49: error: field
‘widgets’ has incomplete type

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;
}


Looking in the .h file generated with:
valac -C --pkg gtk+-2.0 --pkg libglade-2.0 --pkg gmodule-2.0 --basedir
.  src/phoneui.glade.vala

we see:
...
typedef struct _PhoneUIGladewindow_widgets PhoneUIGladewindow_widgets;

struct _PhoneUIGlade {
        GtkObject parent_instance;
        PhoneUIGladePrivate * priv;
        GladeXML* xml;
        PhoneUIGladewindow_widgets widgets;
};

struct _PhoneUIGladeClass {
        GtkObjectClass parent_class;
};

struct _PhoneUIGladewindow_widgets {
        GtkWidget* blah;
        GtkWidget* blah2;
};



So _PhoneUIGladewindow_widgets isn't defined until after it is used, the
wrong order I think. Nested classes/structs should be defined before the
parent.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]