diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 24b9f1651ac..7027cbd7568 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7978,7 +7978,7 @@ namespace ts { } // An instance property must be accessed through an instance of the enclosing class if (type.flags & TypeFlags.ThisType) { - // get the original type -- represented as the type constraint of the this type + // get the original type -- represented as the type constraint of the 'this' type type = getConstraintOfTypeParameter(type); } diff --git a/src/services/services.ts b/src/services/services.ts index 5a8241a5c45..b707afa9ab5 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -4106,7 +4106,8 @@ namespace ts { let allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!contains(allSignatures, signature.target) && !contains(allSignatures, signature)) { - // Get the first signature if there + // Get the first signature if there is one -- allSignatures may contain + // either the original signature or its target, so check for either signature = allSignatures.length ? allSignatures[0] : undefined; }