static void AnalyzeIEnumerableTMethod(SyntaxNodeAnalysisContext context, MethodDeclarationSyntax methodDeclarationSyntax) { if (methodDeclarationSyntax.AllReturnsImplement(SpecialType.System_Collections_Generic_IReadOnlyList_T, context)) { var diagnostic = Diagnostic.Create(Rule, methodDeclarationSyntax.ReturnType.GetLocation(), "IReadOnlyList`1"); context.ReportDiagnostic(diagnostic); return; } if (methodDeclarationSyntax.AllReturnsImplement(SpecialType.System_Collections_Generic_IReadOnlyCollection_T, context)) { var diagnostic = Diagnostic.Create(Rule, methodDeclarationSyntax.ReturnType.GetLocation(), "IReadOnlyCollection`1"); context.ReportDiagnostic(diagnostic); return; } }