Closed
Description
TypeScript Version: 3.1.0-dev.20180813
Search Terms:
Code
declare let node: ts.ClassExpression; // (class {})
checker.getSymbolAtLocation(node); // undefined;
Expected behavior:
getSymbolAtLocation
returns the symbol of the class.
Actual behavior:
For named ClassLikeDeclarations I can use getSymbolAtLocation(node.name)
but that will obviously not work if there is no name.
My current workaround is ts.getTypeAtLocation(node).symbol!
.
Why doesn't getSymbolAtLocation
simply return node.symbol
if none of the conditions match?
In addition there is some special handling of FunctionKeyword
to get the symbol of anonymous functions. Could something similar be implemented for ClassKeyword
?