Re: [Vala] Ternary operator and nullable values in return statements



2010/11/28 Jiří Zárevúcky <zarevucky jiri gmail com>:
You need to cast it like this:
 (0 == number) ? null : (int?) 1

or
 int? i = 1;
 (0 == number) ? null : i


Thank you. That's it of course.

cheers



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