Re: [Vala] incomplete type error:



(Apologies Sam, I accidentally pressed Reply instead of Reply All)

Hmm... I'm not so sure that nested classes/structs should _always_ go
before. But yes you should probably file a bug for that.

Cheers,
Jared Moore

On Tue, Jun 24, 2008 at 1:28 AM, Sam Liddicott <sam liddicott com> wrote:
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.


_______________________________________________
Vala-list mailing list
Vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list




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