Closed
Description
TypeScript Version: 2.3.2
Code
From lib/typescript.d.ts#L1709:
getSymbolAtLocation(node: Node): Symbol;
From src/services/goToDefinition.ts#L45:
let symbol = typeChecker.getSymbolAtLocation(node);
// Could not find a symbol e.g. node is string or number keyword,
// or the symbol was an internal symbol and does not have a declaration e.g. undefined symbol
if (!symbol) {
return undefined;
}
Expected behavior:
Typings for getSymbolAtLocation
should be getSymbolAtLocation(node: Node): Symbol | undefined;
.
I just got undefined
after using getSymbolAtLocation
and didn't expected it.
Actual behavior:
Typings for getSymbolAtLocation
don't include undefined
as a possible return value.