Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial code and tests for the SA1414 Analyzer for converting fie… #2781

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public async Task TestClassWithInternalStaticFieldAsync()
internal static string bar;
}";

// DiagnosticResult expected = this.CSharpDiagnostic().WithLocation(3, 28);
await this.VerifyCSharpDiagnosticAsync(testCode, EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ private static bool IsInternalConst(IFieldSymbol fieldDeclarationSyntax)

private static bool IsProtectedInternal(IFieldSymbol fieldDeclarationSyntax)
{
return fieldDeclarationSyntax.DeclaredAccessibility == Accessibility.ProtectedAndInternal;
// Seems Microsoft.CodeAnalysis.CSharp has a issue with this being "ProtectedAndInternal"
// and detects them as "ProtectedOrInternal". Not sure if by design or just flat out a
// or because the version used is not the newest version bug.
return fieldDeclarationSyntax.DeclaredAccessibility == Accessibility.ProtectedOrInternal;
}

private static bool IsInternal(IFieldSymbol fieldDeclarationSyntax)
Expand Down