3 ms·
> In C#, the modifier can be applied to a method, a lambda expression, or an anonymous method. In all other contexts, the term is interpreted as an identifier.
by yread 15y ago
> In C#, the modifier can be applied to a method, a lambda expression, or an anonymous method. In all other contexts, the term is interpreted as an identifier.
Wow so you can have your cake and eat it! await is an accepted "keyword" but it's not actually a keyword as far as parser is concerned. Cool! I wish other compilers were this conscious of backwards compatibility.
- lmkg 15y agoC# has been pretty scrupulous about using contextual keywords instead of reserved keywords when they add new language features. That's why, e.g., they went with "yield return foo" instead of the more traditional "yield foo." They also let you define "var," which normally denotes type inference, as a normal type, and "var" will refer to the defined type in contexts where it is accessible.