Today I had something weird happen in my copy of Resharper 5. I have a class that looks like this:
public class Foo
{
public string Username { get; private set; }
public Foo (string userName) { Username = userName; }
public void Bar()
{
DoWork(Username);
}
public void DoWork(string userName) { }
}
When I start to type DoWork(us I get the following from intellisense:
Notice that it's pulling up the constructor argument, and it ends with a colon: userName:
What's going on here?
EDIT:
As Reed answered below, this is a new C# 4 feature called Named and Optional Arguments. It's purpose is to allow you to specify the name of an argument, rather than it's position in a parameter list. so you don't have to remember the position of an argument in the argument list to use it (though this is largely meaningless with intellisense). It does make optional arguments easier to use though.
Thanks Reed.