[Vala] Re : Release testing



Hi,

When using a local Glib.Value and pass it by ref to a function, I've got a :
  •  error message if iI on't  initialize it,
  • a warning message if I initialize it with new
  • a runtime warning otherwise :

Code :
Gtk.ListStore model = (Gtk.ListStore) combobox.get_model();
GLib.Value content_type;
model.get_value(iter, 2, ref content_type);
Message :
error: use of possibly unassigned local variable `content_type'
        model.get_value(iter, 2, ref content_type);

Code :
Gtk.ListStore model = (Gtk..ListStore) combobox.get_model();
GLib.Value content_type = new Value(typeof(string));;
model.get_value(iter, 2, ref content_type);

Message 
:
warning: deprecated syntax, don't use `new' to initialize structs
        GLib.Value content_type = new Value(typeof(string));;

Code:
Gtk.ListStore model = (Gtk..ListStore) combobox.get_model();
GLib.Value content_type = Value(typeof(string));;
model.get_value(iter, 2, ref content_type);
Message at runtime:
GLib-GObject-WARNING **: gvalue.c:185: cannot initialize GValue with type `gchararray', the value has already been initialized as `gchararray'




De : Jürg Billeter <j bitron ch>
À : vala-list gnome org
Envoyé le : Samedi, 29 Novembre 2008, 20h25mn 21s
Objet : [Vala] Release testing

Hi all,

I'm planning to release Vala 0.5.2 on Monday evening. As there have been
a lot of changes since 0.5.1, I'd appreciate it if people working on
Vala applications or libraries can do a test run with Vala trunk, so we
can fix regressions before the release.

No incompatible changes in the language have been introduced, however,
more checks have been added. The most noteworthy new check is probably
that the compiler now enforces local variables to be initialized before
being used.

I've uploaded a source tarball[1] to make testing easier in case you
haven't installed 0.5.1 yet.

Regards,
Jürg

[1] http://www.gnome.org/~juergbi/vala-0.5.2-20081129.tar.bz2

_______________________________________________
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]