Re: [Vala] Making a class iterable from VAPI bindings



On Sun, Oct 16, 2011 at 12:47 AM, Calvin Walton <calvin walton kepstin ca>wrote:

So nice, in fact, that I just
added it myself.


Thanks for the contribution.

Now I'm having some additional problems; the code

public static void test(AnnotationList a) {
       foreach (unowned Annotation b in a) {
               test2(b);
       }
}
public static void test2(Annotation a) {
}

Is failing to compile, with the error:
test.vala:5.35-5.36: error: duplicating AnnotationList instance, use
unowned variable or explicitly invoke copy method
       foreach (unowned Annotation b in a) {
                                        ^^

This naturally does work if I do
       foreach (unowned Annotation b in a.clone())
instead, but I'd prefer not to have to make a copy when it's not really
required...


That sounds like a bug, you can report it at bugzilla.gnome.org .

-- 
www.debian.org - The Universal Operating System


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