[Vala] GLib.List<Gtk.TreePath> doesn't work



Hi all,

some days ago I stumbled upon what I think is a bug in Vala, but as I am
not sure, I would like to ask before reporting it.

This is the code:


var selection = this.fileview.get_selection();
var rows = new GLib.List<Gtk.TreePath>();
rows = selection.get_selected_rows(out this.filestore).copy();


The error is:


test.vala:256.28-256.39: error: duplicating TreePath instance, use weak
variable or explicitly invoke copy method

var rows = new GLib.List<Gtk.TreePath>();
                         ^^^^^^^^^^^^


If I comment "var rows = ..." and leave


var selection = this.fileview.get_selection();
var rows = selection.get_selected_rows(out this.filestore).copy();


the error becomes:

gtk+-2.0.vapi:5625.20-5625.31: error: duplicating TreePath instance, use
weak variable or explicitly invoke copy method

public GLib.List<Gtk.TreePath> get_selected_rows (out weak Gtk.TreeModel
model);
                 ^^^^^^^^^^^^


which lead me to think it's a bug in Vala or in the vapi files.

I tried it with Vala 0.3.4, 0.3.5, 0.4.0 and 0.5.1-svn (a couple of days
before the release).
All give the same error.

Thank you very much for any help.

-- 
Alessandro Pellizzari





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