-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not use $Program and $Main for generated top-level code type/method names #45564
Comments
Why would this be a problem? The type and the method are not meant to be referred to by name. Please provide concrete scenario where that would create a problem.
What particular in that pattern gives guarantee to avoid a conflict? Any particular character that EE never uses? Something else? |
I do not have a specific scenario. I'm just saying that EE parses |
See
|
We don't necessarily want them to follow the pattern or be recognized by the Generatedname API(s). In fact, we want them to be available as constants from WellKnownMemberNames so that analyzers and other consumers can get to them. I am fine with changing what characters are used in the names. Would |
We can still expose names that use the pattern defined by I'm not sure why would we not want GeneratedName to not recognize these special names.
That would work - we could define BTW, just noticed another new generated name in WellKnownMemberNames:
Technically it matches the generated pattern. |
'''GeneratedName''' is an internal API and I don't want to spend any time on it, unless there is a real-world scenario that is going to be affected. So far, I am not aware of any. |
Then I propose we change the names to
which would require UPDATE: Actually, a minor change would be needed in this condition. |
Closes dotnet#45564. Related to dotnet#45110.
$Program
and$Main
are valid identifiers in EE context, so there might be a potential confusion.It would be better to use the pattern already established for other generated names in C# compiler:
http://sourceroslyn.io/#Microsoft.CodeAnalysis.CSharp/Symbols/Synthesized/GeneratedNames.cs,25
The text was updated successfully, but these errors were encountered: