Fix this.member completion+quickinfo of overloads

1. Completion after `this.` was empty.
2. Quick info of methods with overloads always chose the first overload,
regardless of whether an argument whose type matched a different overload.

Both have the same cause: the type parameter introduced by
polymorphic `this` is not usable, whereas the original is. In both cases,
the usage is simple -- it doesn't take advantage of the capabilities of
polymorphic `this`.
This commit is contained in:
Nathan Shively-Sanders
2015-10-08 08:11:33 -07:00
parent 78ad0f4c82
commit 2fb6eabc2e
2 changed files with 6 additions and 1 deletions

View File

@@ -4105,7 +4105,7 @@ namespace ts {
let useConstructSignatures = callExpression.kind === SyntaxKind.NewExpression || callExpression.expression.kind === SyntaxKind.SuperKeyword;
let allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures();
if (!contains(allSignatures, signature.target || signature)) {
if (!contains(allSignatures, signature.target) && !contains(allSignatures, signature)) {
// Get the first signature if there
signature = allSignatures.length ? allSignatures[0] : undefined;
}