@@ -136,13 +136,12 @@ private static void HandleInvocationExpression(SyntaxNodeAnalysisContext context
136136 }
137137
138138 var memberAccessExpression = ( MemberAccessExpressionSyntax ) invocationExpression . Expression ;
139-
140- var symbolInfo = context . SemanticModel . GetSymbolInfo ( memberAccessExpression . Expression ) ;
141- if ( symbolInfo . Symbol is INamedTypeSymbol namedTypeSymbol
142- && namedTypeSymbol . ToDisplayString ( DisplayFormat ) == "System.ValueTuple"
143- && ! context . Node . IsInExpressionTree ( context . SemanticModel , expressionType , context . CancellationToken ) )
139+ if ( memberAccessExpression . Name . Identifier . ValueText == "Create" )
144140 {
145- if ( memberAccessExpression . Name . Identifier . ValueText == "Create" )
141+ var symbolInfo = context . SemanticModel . GetSymbolInfo ( memberAccessExpression . Expression ) ;
142+ if ( symbolInfo . Symbol is INamedTypeSymbol namedTypeSymbol
143+ && namedTypeSymbol . ToDisplayString ( DisplayFormat ) == "System.ValueTuple"
144+ && ! context . Node . IsInExpressionTree ( context . SemanticModel , expressionType , context . CancellationToken ) )
146145 {
147146 context . ReportDiagnostic ( Diagnostic . Create ( Descriptor , memberAccessExpression . GetLocation ( ) ) ) ;
148147 }
@@ -209,7 +208,8 @@ private static void CheckTupleType(SyntaxNodeAnalysisContext context, INamedType
209208
210209 private static void CheckGenericName ( SyntaxNodeAnalysisContext context , INamedTypeSymbol expressionType , GenericNameSyntax genericNameSyntax , Location reportLocation )
211210 {
212- if ( IsValueTupleWithLanguageRepresentation ( context , expressionType , genericNameSyntax ) )
211+ if ( genericNameSyntax . Identifier . ValueText == "ValueTuple"
212+ && IsValueTupleWithLanguageRepresentation ( context , expressionType , genericNameSyntax ) )
213213 {
214214 var location = reportLocation ?? genericNameSyntax . GetLocation ( ) ;
215215 context . ReportDiagnostic ( Diagnostic . Create ( Descriptor , location ) ) ;
0 commit comments