Skip to content

Commit

Permalink
Merge pull request #1523 from pdelvo/1501workaround
Browse files Browse the repository at this point in the history
Implement a workaround for #1501
  • Loading branch information
sharwell committed Sep 25, 2015
2 parents f3ddc0e + fac59f2 commit 19a8d65
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,20 @@ private static void HandleIdentifierNameImpl(SyntaxNodeAnalysisContext context,
{
return;
}

// This is a workaround for https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/1501 and can
// be removed when the underlying bug in roslyn is resolved
if (nameExpression.Parent is MemberAccessExpressionSyntax)
{
var parentSymbol = context.SemanticModel.GetSymbolInfo(nameExpression.Parent, context.CancellationToken).Symbol as IFieldSymbol;

if (parentSymbol.IsStatic && parentSymbol.ContainingType.Name == symbol.Name)
{
return;
}
}

// End of workaround
}

// Prefix local calls with this
Expand Down

0 comments on commit 19a8d65

Please sign in to comment.