[Vala] possible bug in nullable enum



Hi,

it seems to me that there's some sort of bug involved when I declare some enum variable as nullable - this 
code:

enum MyEnum { ONE, TWO }
int main(string[] args)
{
    MyEnum a = MyEnum.ONE;
    if (a == MyEnum.ONE)
        stdout.printf("a is one\n");

    MyEnum? b = MyEnum.ONE;
    if (b == MyEnum.ONE)
        stdout.printf("b is one\n");
    return 0;
}

prints only "a is one" when "b" is declared as "MyEnum?", but works correctly when declared as a "MyEnum".

Is this a bug or am I doing something wrong?

Regards,
Jan Spurny



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