-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Labels
Area-CompilersFeature - Extension EverythingThe extension everything featureThe extension everything feature
Milestone
Description
This issue is referenced in source.
- Consider refining
GetExtensionDeclarationslogic (shown below) to tracked used usings more finely Extensions: refine tracking of used imports #80485 - Test
IsSemanticModelBinderflag (tracked in source) Extensions: Close some tracked follow-ups (using static directives) #80527
internal override void GetExtensionDeclarations(ArrayBuilder<NamedTypeSymbol> extensions, Binder originalBinder)
{
Debug.Assert(extensions.Count == 0);
// Tracked by https://github.com/dotnet/roslyn/issues/79440 : using directives, test this flag (see TestUnusedExtensionMarksImportsAsUsed)
bool callerIsSemanticModel = originalBinder.IsSemanticModelBinder;
foreach (var nsOrType in this.GetUsings(basesBeingResolved: null))
{
if (nsOrType.NamespaceOrType is NamespaceSymbol ns)
{
var count = extensions.Count;
ns.GetExtensionContainers(extensions);
// If we found any extension declarations, then consider this using as used.
// Tracked by https://github.com/dotnet/roslyn/issues/79440 : using directives, consider refining this logic
if (extensions.Count != count)
{
MarkImportDirective(nsOrType.UsingDirectiveReference, callerIsSemanticModel);
}
}
...Relates to test plan #76130
Metadata
Metadata
Assignees
Labels
Area-CompilersFeature - Extension EverythingThe extension everything featureThe extension everything feature