1
Vote

SA0001 failure on "is" keyword

description

This line:
if (value is DateTime)
Causes StyleCop+ to be unable to parse the file in which it is contained:
SA0001 : CoreParser : An exception occurred while parsing the file: System.InvalidCastException, Unable to cast object of type 'StyleCop.CSharp.IsExpression' to type 'StyleCop.CSharp.LambdaExpression'.
   at StyleCopPlus.CodeHelper.GetParametersExpressionVisitor(Expression expression, Expression parentExpression, Statement parentStatement, CsElement parentElement, List`1 result)
   at StyleCop.CSharp.CodeWalker`1.VisitExpression(Expression expression, Expression parentExpression, Statement parentStatement, CsElement parentElement, T& context)
   at StyleCop.CSharp.CodeWalker`1.WalkExpression(Expression expression, Expression parentExpression, Statement parentStatement, CsElement parentElement, T context)
   at StyleCop.CSharp.CodeWalker`1.WalkStatement(Statement statement, Expression parentExpression, Statement parentStatement, CsElement parentElement, T context)
   at StyleCop.CSharp.CodeWalker`1.WalkElement(CsElement element, CsElement parentElement, T context)
   at StyleCopPlus.CodeHelper.GetParameters(CsElement element)
   at StyleCopPlus.Plugin.AdvancedNaming.AdvancedNamingRules.CheckParameters(CsElement element, CurrentNamingSettings settings)
   at StyleCopPlus.Plugin.AdvancedNaming.AdvancedNamingRules.AnalyzeMethod(CsElement element, CurrentNamingSettings settings)
   at StyleCopPlus.Plugin.AdvancedNaming.AdvancedNamingRules.AnalyzeElement(CsElement element, CurrentNamingSettings settings)
   at StyleCopPlus.Plugin.AdvancedNaming.AdvancedNamingRules.AnalyzeElements(IEnumerable`1 elements, CurrentNamingSettings settings)
   at StyleCopPlus.Plugin.AdvancedNaming.AdvancedNamingRules.AnalyzeElements(IEnumerable`1 elements, CurrentNamingSettings settings)
   at StyleCopPlus.Plugin.AdvancedNaming.AdvancedNamingRules.AnalyzeElements(IEnumerable`1 elements, CurrentNamingSettings settings)
   at StyleCopPlus.Plugin.AdvancedNaming.AdvancedNamingRules.AnalyzeDocument(CodeDocument document)
   at StyleCopPlus.StyleCopPlusRules.AnalyzeDocument(CodeDocument document)
   at StyleCop.StyleCopThread.RunAnalyzers(CodeDocument document, SourceParser parser, IEnumerable`1 analyzers)
   at StyleCop.StyleCopThread.TestAndRunAnalyzers(CodeDocument document, SourceParser parser, IEnumerable`1 analyzers, Int32 passNumber)
   at StyleCop.StyleCopThread.ParseAndAnalyzeDocument(SourceCode sourceCode, DocumentAnalysisStatus documentStatus)
   at StyleCop.StyleCopThread.DoWork(Object sender).

comments