Fix quick info for methods whose contextual type is a mapped type property (#33930)

This commit is contained in:
Andrew Branch
2019-10-17 10:54:01 -07:00
committed by GitHub
parent a95a25b9a7
commit f41b7b59ce
2 changed files with 10 additions and 1 deletions

View File

@@ -237,7 +237,7 @@ namespace ts.SymbolDisplay {
// get the signature from the declaration and write it
const functionDeclaration = <FunctionLike>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) {

View File

@@ -0,0 +1,9 @@
/// <reference path="fourslash.ts" />
// https://github.com/microsoft/TypeScript/issues/32983
////type M = { [K in 'one']: any };
////const x: M = {
//// /**/one() {}
////}
verify.quickInfoAt("", "(property) one: any");