Breaking changes and named arguments

Before I get into the subject of today’s post, thanks so much to all of you who have given us great feedback on the Roslyn CTP. Please keep it coming. I’m definitely going to do some articles on Roslyn in the future; the past few weeks I have been too busy actually implementing it to…

29

Optional argument corner cases, part four

(This is the fourth and final part of a series on the corner cases of optional arguments in C# 4; part three is here.) Last time we discussed how some people think that an optional argument generates a bunch of overloads that call each other. People also sometimes incorrectly think that void M(string format, bool…

18

Optional argument corner cases, part three

(This is part three of a series on the corner cases of optional arguments in C# 4; part two is here. Part four is here.) A lot of people seem to think that this: void M(string x, bool y = false) { … whatever … } is actually a syntactic sugar for the way you…

6

Optional argument corner cases, part two

(This is part two of a series on the corner cases of optional arguments in C# 4. Part one is here. Part three is here. This portion of the series was inspired by this StackOverflow question.) Last time we saw that the declared optional arguments of an interface method need not be optional arguments of…

11

Optional argument corner cases, part one

(This is part one of a series on the corner cases of optional arguments in C# 4. Part two is here.) In C# 4.0 we added “optional arguments”; that is, you can state in the declaration of a method’s parameter that if certain arguments are omitted, then constants can be substituted for them: void M(int…

10