Skip to content

Commit

Permalink
dotnet#1638: use .SpecialType to check for string
Browse files Browse the repository at this point in the history
  • Loading branch information
jongleur1983 committed Oct 13, 2018
1 parent 16a18fe commit d805096
Showing 1 changed file with 2 additions and 3 deletions.
Expand Up @@ -95,9 +95,8 @@ private void Action(OperationAnalysisContext context)
if (argument.Value is IInvocationOperation invocationExpression
&& invocationExpression.TargetMethod is IMethodSymbol parameterMethod
&& parameterMethod.Name == nameof(String.Substring)
&& parameterMethod.ContainingSymbol.Name == nameof(String)
&& parameterMethod.ContainingSymbol.ContainingNamespace.Name == nameof(System)
&& parameterMethod.ContainingSymbol.ContainingNamespace.ContainingNamespace.IsGlobalNamespace)
&& parameterMethod.ContainingSymbol is INamedTypeSymbol parameterMethodOwner
&& parameterMethodOwner.SpecialType == SpecialType.System_String)
{
switch (parameterMethod.Parameters.Length)
{
Expand Down

0 comments on commit d805096

Please sign in to comment.