[Vala] typeof is return type is not anymore constant... Why?



Once was possible to do something like:

        const Type t = typeof(string);

Now it's not possible anymore, and I get this error:
        /tmp/init.vala:10.17-10.30: error: Value must be constant
                const Type t = typeof(string);
                               ^^^^^^^^^^^^^^
Is this a bug or a feature? I was using it to define a const struct
like:

        struct MyType {
                public string name;
                public Type type;
        }

        const MyType[] types = {{"string_value", typeof(string)},
                                {"int_value", typeof(int)}};

Now I can't anymore (I have to use an external const value as
workaround).





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