mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-10 21:07:52 -05:00
findAllRefs: Fix bug when symbol.declarations is undefined (#27977)
This commit is contained in:
@@ -143,7 +143,7 @@ namespace ts.FindAllReferences {
|
||||
|
||||
function getDefinitionKindAndDisplayParts(symbol: Symbol, checker: TypeChecker, node: Node): { displayParts: SymbolDisplayPart[], kind: ScriptElementKind } {
|
||||
const meaning = Core.getIntersectingMeaningFromDeclarations(node, symbol);
|
||||
const enclosingDeclaration = firstOrUndefined(symbol.declarations) || node;
|
||||
const enclosingDeclaration = symbol.declarations && firstOrUndefined(symbol.declarations) || node;
|
||||
const { displayParts, symbolKind } =
|
||||
SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, enclosingDeclaration.getSourceFile(), enclosingDeclaration, enclosingDeclaration, meaning);
|
||||
return { displayParts, kind: symbolKind };
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @strict: true
|
||||
|
||||
////function f(x: { [K in "m"]: number; }) {
|
||||
//// x.[|m|];
|
||||
//// x.[|m|]
|
||||
////}
|
||||
|
||||
verify.singleReferenceGroup("(property) m: number");
|
||||
Reference in New Issue
Block a user