Skip to content

Commit

Permalink
Implement a workaround for DotNetAnalyzers#1501
Browse files Browse the repository at this point in the history
  • Loading branch information
pdelvo committed Sep 21, 2015
1 parent 98b446f commit c4ce309
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,21 @@ 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?.ContainingType.BaseType.SpecialType == SpecialType.System_Enum
&& parentSymbol.ContainingType.Name == symbol.Name)
{
return;
}
}

// End of workaround
}

// Prefix local calls with this
Expand Down

0 comments on commit c4ce309

Please sign in to comment.