Exclude entry points from unused members analysis#45090
Exclude entry points from unused members analysis#45090sharwell merged 1 commit intodotnet:masterfrom
Conversation
|
|
||
| private bool IsEntryPoint(IMethodSymbol methodSymbol) | ||
| => methodSymbol.Name == WellKnownMemberNames.EntryPointMethodName && | ||
| => (methodSymbol.Name == WellKnownMemberNames.EntryPointMethodName || methodSymbol.Name == "$Main") && |
There was a problem hiding this comment.
@AlekseyTs Ideally we would use a helper for "unspeakable names", but I couldn't find one. Can you point us in the right direction?
There was a problem hiding this comment.
Ideally we would use a helper for "unspeakable names", but I couldn't find one. Can you point us in the right direction?
SyntaxFacts.IsValidIdentifier?
There was a problem hiding this comment.
You also mentioned ISymbol.CanBeReferencedByName offline. However, it doesn't feel right to include all methods with unspeakable names into entry points.
In reply to: 439097752 [](ancestors = 439097752)
|
|
||
| private bool IsEntryPoint(IMethodSymbol methodSymbol) | ||
| => methodSymbol.Name == WellKnownMemberNames.EntryPointMethodName && | ||
| => (methodSymbol.Name == WellKnownMemberNames.EntryPointMethodName || methodSymbol.Name == "$Main") && |
There was a problem hiding this comment.
"$Main" [](start = 107, length = 7)
Perhaps we should move constant from SynthesizedSimpleProgramEntryPointSymbol to WellKnownMemberNames and use it here?
There was a problem hiding this comment.
Perhaps we should move constant from SynthesizedSimpleProgramEntryPointSymbol to WellKnownMemberNames and use it here?
I'll file a follow-up issue for this.
|
CC @mavasani |
Fixes #45496