diff --git a/src/services/symbolDisplay.ts b/src/services/symbolDisplay.ts index 0dc540dcaca..faff3620d62 100644 --- a/src/services/symbolDisplay.ts +++ b/src/services/symbolDisplay.ts @@ -237,7 +237,7 @@ namespace ts.SymbolDisplay { // get the signature from the declaration and write it const functionDeclaration = location.parent; // Use function declaration to write the signatures only if the symbol corresponding to this declaration - const locationIsSymbolDeclaration = find(symbol.declarations, declaration => + const locationIsSymbolDeclaration = symbol.declarations && find(symbol.declarations, declaration => declaration === (location.kind === SyntaxKind.ConstructorKeyword ? functionDeclaration.parent : functionDeclaration)); if (locationIsSymbolDeclaration) { diff --git a/tests/cases/fourslash/quickInfoMappedTypeMethods.ts b/tests/cases/fourslash/quickInfoMappedTypeMethods.ts new file mode 100644 index 00000000000..8107775b9e4 --- /dev/null +++ b/tests/cases/fourslash/quickInfoMappedTypeMethods.ts @@ -0,0 +1,9 @@ +/// +// https://github.com/microsoft/TypeScript/issues/32983 + +////type M = { [K in 'one']: any }; +////const x: M = { +//// /**/one() {} +////} + +verify.quickInfoAt("", "(property) one: any");