Navigation Menu

Skip to content

Commit

Permalink
Remove unnecessary check on MakeLocalVariableConstWhenItIsPossibleAna…
Browse files Browse the repository at this point in the history
…lyzer

Also add `Fact` to missing test
Related to #774
  • Loading branch information
giggio committed Sep 6, 2016
1 parent 4dc4707 commit 352b6b3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Expand Up @@ -36,8 +36,6 @@ private static void AnalyzeNode(SyntaxNodeAnalysisContext context)
var localDeclaration = (LocalDeclarationStatementSyntax)context.Node;
var semanticModel = context.SemanticModel;

if (localDeclaration.GetType().IsPointer) return;

if (!localDeclaration.IsConst
&& IsDeclarationConstFriendly(localDeclaration, semanticModel)
&& AreVariablesOnlyWrittenInsideDeclaration(localDeclaration, semanticModel) )
Expand Down
Expand Up @@ -52,6 +52,7 @@ public async Task IgnoresVariablesThatChangesValueOutsideDeclaration()
await VerifyCSharpHasNoDiagnosticsAsync(test);
}

[Fact]
public async Task IgnoresPointerDeclarations()
{
var test = @"void* value = null;".WrapInCSharpMethod();
Expand Down

0 comments on commit 352b6b3

Please sign in to comment.