AD0001 Analyzer 'FakeItEasy.Analyzer.UnusedReturnValueAnalyzer' threw an exception
See original GitHub issueI was trying out https://www.nuget.org/packages/FakeItEasy.Analyzer/
and got a bunch of warnings, all in the same style.
The SyntaxNode
exists, but isn’t called in any way by FakeItEasy (A.
…) code.
Don’t know if you guys can make something of this, if not then close as I wont be spending time analyzing this further.
Severity Code Description Project File Line Source Suppression State Detail Description
Warning AD0001 Analyzer 'FakeItEasy.Analyzer.UnusedReturnValueAnalyzer' threw an exception of type 'System.ArgumentNullException' with message 'Value cannot be null.
Parameter name: syntax'. <Project> 1 IntelliSense Active Analyzer 'FakeItEasy.Analyzer.UnusedReturnValueAnalyzer' threw the following exception:
'Exception occurred with following context:
Compilation: <Project>
SyntaxTree: C:\Source\<Project>\AnalyzerTests.cs
SyntaxNode: CreateId() [InvocationExpressionSyntax]@[4016..4026) (118,46)-(118,56)
System.ArgumentNullException: Value cannot be null.
Parameter name: syntax
at Microsoft.CodeAnalysis.CSharp.CSharpSemanticModel.CheckSyntaxNode(CSharpSyntaxNode syntax)
at Microsoft.CodeAnalysis.CSharp.CSharpSemanticModel.GetSymbolInfo(ExpressionSyntax expression, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.CSharp.CSharpExtensions.GetSymbolInfo(SemanticModel semanticModel, ExpressionSyntax expression, CancellationToken cancellationToken)
at FakeItEasy.Analyzer.UnusedReturnValueAnalyzer.GetCalledMethodSymbol(InvocationExpressionSyntax call, SyntaxNodeAnalysisContext context)
at FakeItEasy.Analyzer.UnusedReturnValueAnalyzer.AnalyzeCall(SyntaxNodeAnalysisContext context)
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c__DisplayClass42_1`1.<ExecuteSyntaxNodeAction>b__1()
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock(DiagnosticAnalyzer analyzer, Action analyze, Nullable`1 info)
-----
'.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Mertsch OK, thanks. I’ve managed to reproduce it now. The use of JetBrains.Annotations appears to be irrelevant:
Install-Package FakeItEasy.Analyzer
This issue has been fixed in release 2.1.0.
Thanks for your help, @Mertsch. Look for your name in the release notes! 🏆