Re: [Vala] Struct property bug: get, but not set




Not a bug.

Explanation:
http://bugzilla.gnome.org/show_bug.cgi?id=621787

So, the code

        var button = new Gtk.ColorButton ();
        button.color.red = 100; /*1*/

should have been invalid. (A compiler bug, but
a different kind).

But, since vala is a higher level language than C,
is there any strong reason to absolutely treat
"button.color.red = 100" as invalid. Can't the 
compiler treat it as a shortcut for:

        var c = button.color;
        c.red = 100;
        button.color = c;

? Are there any cases where such shortcuts do not
work?

hand
Nor Jaidi Tuah





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