This project is read-only.
2

Resolved

Character comparison converts to Int32 values

description

If I have a comparison such as:
'a' == 'a'
The TypeInfo for both sides of this expression reports that the Type is Char and the ConvertedType is Int32. It seems like there should be no conversion here and ConvertedType should be Char as well.

comments

nmgafter wrote Aug 9, 2014 at 8:37 PM

According to section 7.10.1 of the C# language specification, there is no == comparison between char values. They must first be converted to int values.