Luca Bruno wrote:
> Hi, it's not possible (at least for now) due to C limitations: see
> https://bugzilla.gnome.org/show_bug.cgi?id=543189

However, a dummy instantiation before first static access should work:

class Statico : Object {

        public static int test_value;

        static construct {
                test_value = 5;
        }

        public static int get_test_value () {
                return test_value;
        }
}

void main () {
        new Statico ();
        stdout.printf ("%d\n", Statico.get_test_value ());
}


Best regards,

Frederik
_______________________________________________
vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to