public static void Analyze(SyntaxNodeAnalysisContext context, GenericNameSyntax genericName) { if (!genericName.IsParentKind(SyntaxKind.QualifiedName, SyntaxKind.UsingDirective)) { TypeArgumentListSyntax typeArgumentList = genericName.TypeArgumentList; if (typeArgumentList != null) { SeparatedSyntaxList <TypeSyntax> arguments = typeArgumentList.Arguments; if (arguments.Count == 1 && !arguments[0].IsKind(SyntaxKind.OmittedTypeArgument)) { var namedTypeSymbol = context.SemanticModel.GetSymbol(genericName, context.CancellationToken) as INamedTypeSymbol; if (namedTypeSymbol?.IsConstructedFrom(SpecialType.System_Nullable_T) == true) { context.ReportDiagnostic( DiagnosticDescriptors.SimplifyNullableOfT, genericName); } } } } }