Skip to content

Commit 0d2b2d8

Browse files
Add back
1 parent c1716fa commit 0d2b2d8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Analyzers/Core/Analyzers/RemoveUnusedMembers/AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,11 @@ private void AnalyzeInvocationOperation(OperationAnalysisContext operationContex
455455
// A method invocation is considered as a read reference to the symbol
456456
// to ensure that we consider the method as "used".
457457
OnSymbolUsage(targetMethod, ValueUsageInfo.Read);
458+
459+
//// If the invoked method is a reduced extension method, also mark the original
460+
//// method from which it was reduced as "used".
461+
if (targetMethod.ReducedFrom != null)
462+
OnSymbolUsage(targetMethod.ReducedFrom, ValueUsageInfo.Read);
458463
}
459464

460465
private void AnalyzeNameOfOperation(OperationAnalysisContext operationContext)

0 commit comments

Comments
 (0)