-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Area-Language DesignFeature RequestLanguage-C#Resolution-Won't FixA real bug, but Triage feels that the issue is not impactful enough to spend time on.A real bug, but Triage feels that the issue is not impactful enough to spend time on.
Description
Problem
Currently built-in types (int, string, etc) in C# are full keywords.
However, some of those names might be useful variable/parameter names depending on the situation.
For example:
foreach (var @byte in hash) ...
foreach (var @char in name) ...
var @object = json.ToObject();At the moment, these names require @-escaping -- which is not well-known to most people and rather inconvenient.
Proposed solution
Change grammar so that those type keywords are well-known type names instead of full keywords.
This would be similar to how var is handled at the moment.
Pros:
- Less special names in the language -- more choice for identifier names
- More consistent type identifier handling -- both
var/dynamicandintwill be same for the parser
Cons:
- Colorizers will have to be smarter (but then they already have to, due to
var/dynamic)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area-Language DesignFeature RequestLanguage-C#Resolution-Won't FixA real bug, but Triage feels that the issue is not impactful enough to spend time on.A real bug, but Triage feels that the issue is not impactful enough to spend time on.