How do I get the symbol info of the instance in a CatchDeclaration? Basically I want to get the symbol so that I can compare it later to see that a method was called on that symbol.
Basically I have this: catch (Exception ex) {}
and I want the SymbolInfo for "ex".
I get the catch declaration with:
var catchDeclaration = catchClause.DescendantNodes().OfType<CatchDeclarationSyntax>().FirstOrDefault();
But I seem to only be able to get the SyntaxToken from the declaration (catchDeclaration.Identifier
) which cannot be used to get a symbol from the semantic model since that only takes a SyntaxNode.