Dimmed explicit casts

Topics: APIs
Apr 9, 2014 at 5:45 PM
Edited Apr 9, 2014 at 5:46 PM
I have noticed that some explicit casts (at least in C#) are dimmed with the Roslyn preview. I am sure there is some cool reason behind it, so what does the dimming tell me?

For example:
object a, b;
if ((bool)a)
    return (bool)b ? 0 : 1;
The first cast is dimmed, the second one is not.
Apr 9, 2014 at 6:27 PM
That looks like a bug, if you put the cursor on the dimmed cast you get a suggestion to remove the unnecessary cast. Obviously, if you do remove that cast the code will fail to compile.
Marked as answer by JanKucera on 4/9/2014 at 11:57 AM
Apr 9, 2014 at 6:57 PM
Oh I see, I was expecting some suggestion in the tooltip. The light bulb does not really work for me, local smart tags were better.
I will file it in the issues then.