I built my project locally and it worked with a code similar to the following:
bool success = true;
int y = 0;
int? x = success ? y : null;
But our build machine failed with the following error:
error CS0173: Type of conditional expression cannot be determined because there is no implicit conversion between 'int' and '<null>'
So, I had to update the code to:
bool success = true;
int y = 0;
int? x = success ? (int?)y : null;
That made the build machine build the project properly. I am assuming that happened due to some kind of update I had locally that the build machine didn't have. Maybe a C# update, but I couldn't find anything. Does anybody know if there was any update related to this recently and do you have a link to a documentation?
System info:
- Visual Studio Community 2019 for Mac
- Version 8.8.3 (build 16)
- GTK+ 2.24.23 (Raleigh theme)
- Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)
- Package version: 612000107
- Version 8.8.3 (build 16)