Add method signature handler to getTypeOfVariableOrParameterOrProperty (#20825)

This commit is contained in:
Wesley Wigham
2017-12-28 19:00:54 -08:00
committed by GitHub
parent 196f1c2086
commit ae211983eb
5 changed files with 54 additions and 1 deletions

View File

@@ -4683,7 +4683,8 @@ namespace ts {
else if (isJSDocPropertyTag(declaration)
|| isPropertyAccessExpression(declaration)
|| isIdentifier(declaration)
|| isMethodDeclaration(declaration) && !isObjectLiteralMethod(declaration)) {
|| (isMethodDeclaration(declaration) && !isObjectLiteralMethod(declaration))
|| isMethodSignature(declaration)) {
// TODO: Mimics old behavior from incorrect usage of getWidenedTypeForVariableLikeDeclaration, but seems incorrect
type = tryGetTypeFromEffectiveTypeNode(declaration) || anyType;
}