Type this code in C#:
ConsoleColor c;
c =
As soon as you finish typing c =
, intellisense presents a list of values from the ConsoleColor
enum as expected. Now change it to a nullable:
ConsoleColor? c;
c =
After you type the =
, you'd expect intellisense to do the same as before, but it doesn't. I can't even get the enum list to invoke with CTRL+SPACE
. In order to get it intellisense to invoke properly, I have to type c.Value =
, but that just results in a build error because you can't assign a value to a read-only property. Oddly, it works as expected in VB.NET:
Dim c As ConsoleColor?
c = ConsoleColor.Black
Is this just a bug/quirk?
EDIT you can probably disregard my answer, since I'm using ReSharper. I forget that sometimes.
Here's a weird thing: In VS2012, if I type this:
ConsoleColor? c;
c=
I get no IntelliSense. If I type this:
ConsoleColor? c;
c =
I do get IntelliSense. For those who have trouble spotting the difference, it's the space between c
and =
. I also need to type another space after the =
before IntelliSense pops up with suggestions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With