Type of conditional expression cannot be determined because there is no implicit conversion between ‘int’ and

Why does this not compile?

int? number = true ? 5 : null;

Type of conditional expression cannot be determined because there is no implicit conversion between ‘int’ and <null>

4 Answers
4

Leave a Comment