why the below line is not compiled
short x = condition ? 0 : 1;
and I have to cast it
short x = (short) (condition ? 0 : 1);
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@taha3azab
That's because integral numeric literals are of type int. That's detailed in the C# spec on integer literals
Closing this.
Most helpful comment
@taha3azab
That's because integral numeric literals are of type
int. That's detailed in the C# spec on integer literalsClosing this.