Skip to content

Commit f41b7b5

Browse files
authored
Fix quick info for methods whose contextual type is a mapped type property (#33930)
1 parent a95a25b commit f41b7b5

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/services/symbolDisplay.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ namespace ts.SymbolDisplay {
237237
// get the signature from the declaration and write it
238238
const functionDeclaration = <FunctionLike>location.parent;
239239
// Use function declaration to write the signatures only if the symbol corresponding to this declaration
240-
const locationIsSymbolDeclaration = find(symbol.declarations, declaration =>
240+
const locationIsSymbolDeclaration = symbol.declarations && find(symbol.declarations, declaration =>
241241
declaration === (location.kind === SyntaxKind.ConstructorKeyword ? functionDeclaration.parent : functionDeclaration));
242242

243243
if (locationIsSymbolDeclaration) {
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/// <reference path="fourslash.ts" />
2+
// https://github.com/microsoft/TypeScript/issues/32983
3+
4+
////type M = { [K in 'one']: any };
5+
////const x: M = {
6+
//// /**/one() {}
7+
////}
8+
9+
verify.quickInfoAt("", "(property) one: any");

0 commit comments

Comments
 (0)