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

SA1313 reporting AD0001 due to InvalidCastException #1442

Closed
sharwell opened this issue Sep 10, 2015 · 0 comments
Closed

SA1313 reporting AD0001 due to InvalidCastException #1442

sharwell opened this issue Sep 10, 2015 · 0 comments
Assignees
Milestone

Comments

@sharwell
Copy link
Member

Source code where this occurs:

if (node.Content.All(_ => _.IsKind(SyntaxKind.XmlText)))
{
}

Exception:

Analyzer 'StyleCop.Analyzers.NamingRules.SA1313ParameterNamesMustBeginWithLowerCaseLetter' threw an exception of type 'System.InvalidCastException' with message 'Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Syntax.SimpleLambdaExpressionSyntax' to type 'Microsoft.CodeAnalysis.CSharp.Syntax.ParameterListSyntax'.'.   Analyzer 'StyleCop.Analyzers.NamingRules.SA1313ParameterNamesMustBeginWithLowerCaseLetter' threw the following exception:
'System.InvalidCastException: Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Syntax.SimpleLambdaExpressionSyntax' to type 'Microsoft.CodeAnalysis.CSharp.Syntax.ParameterListSyntax'.
   at StyleCop.Analyzers.NamingRules.SA1313ParameterNamesMustBeginWithLowerCaseLetter.NameMatchesAbstraction(ParameterSyntax syntax, SemanticModel semanticModel)
   at StyleCop.Analyzers.NamingRules.SA1313ParameterNamesMustBeginWithLowerCaseLetter.HandleParameterSyntax(SyntaxNodeAnalysisContext context)
   at StyleCop.Analyzers.AnalyzerExtensions.<>c__DisplayClass2_0`1.<RegisterSyntaxNodeActionHonorExclusions>b__0(SyntaxNodeAnalysisContext c)
   at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c__DisplayClass35_0`1.<ExecuteSyntaxNodeAction>b__1()
   at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock(DiagnosticAnalyzer analyzer, Action analyze)'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant