You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Severity Code Description Project File Line Suppression State Details
Warning AD0001 Analyzer 'IDisposableAnalyzers.DisposeCallAnalyzer' threw an exception of type 'System.InvalidCastException' with message 'Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Symbols.PublicModel.FunctionPointerTypeSymbol' to type 'Microsoft.CodeAnalysis.IMethodSymbol'.'.
Exception occurred with following context:
Compilation: AnalyzerRepro
SyntaxTree: D:\source\test\AnalyzerRepro\AnalyzerRepro\Program.cs
SyntaxNode: ((delegate* unmanaged<void>)null ... [InvocationExpressionSyntax]@[206..241) (12,27)-(12,62)
System.InvalidCastException: Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Symbols.PublicModel.FunctionPointerTypeSymbol' to type 'Microsoft.CodeAnalysis.IMethodSymbol'.
at Gu.Roslyn.AnalyzerExtensions.SemanticModelExt.GetSymbolSafe(SemanticModel semanticModel, InvocationExpressionSyntax node, CancellationToken cancellationToken)
at Gu.Roslyn.AnalyzerExtensions.SemanticModelExt.TryGetSymbol(SemanticModel semanticModel, InvocationExpressionSyntax node, CancellationToken cancellationToken, IMethodSymbol& symbol)
at Gu.Roslyn.AnalyzerExtensions.InvocationExpressionSyntaxExt.IsSymbol(InvocationExpressionSyntax candidate, QualifiedMethod symbol, SemanticModel semanticModel, CancellationToken cancellationToken)
at IDisposableAnalyzers.DisposeCall.MatchDispose(InvocationExpressionSyntax candidate, SemanticModel semanticModel, CancellationToken cancellationToken)
at IDisposableAnalyzers.DisposeCallAnalyzer.Handle(SyntaxNodeAnalysisContext context)
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock[TArg](DiagnosticAnalyzer analyzer, Action`1 analyze, TArg argument, Nullable`1 info, CancellationToken cancellationToken)
-----
Suppress the following diagnostics to disable this analyzer: IDISP007, IDISP016, IDISP017 AnalyzerRepro D:\source\test\AnalyzerRepro\AnalyzerRepro\AnalyzerRepro.csproj 1 Active
Hi @JohanLarsson, I'm hitting AD0001 for the following snippet with version
4.0.7
:with the error
Possibly relevant: #308
The text was updated successfully, but these errors were encountered: