@@ -20386,25 +20386,8 @@ namespace ts {
20386
20386
}
20387
20387
20388
20388
function isValidPropertyAccessForCompletions(node: PropertyAccessExpression | ImportTypeNode | QualifiedName, type: Type, property: Symbol): boolean {
20389
- return isValidPropertyAccessWithType(node, node.kind === SyntaxKind.PropertyAccessExpression && node.expression.kind === SyntaxKind.SuperKeyword, property.escapedName, type)
20390
- && (!(property.flags & SymbolFlags.Method) || isValidMethodAccess(property, type));
20391
- }
20392
- function isValidMethodAccess(method: Symbol, actualThisType: Type): boolean {
20393
- const propType = getTypeOfPropertyOfType(actualThisType, method.escapedName)!;
20394
- const signatures = getSignaturesOfType(getNonNullableType(propType), SignatureKind.Call);
20395
- Debug.assert(signatures.length !== 0);
20396
- return signatures.some(sig => {
20397
- const signatureThisType = getThisTypeOfSignature(sig);
20398
- return !signatureThisType || isTypeAssignableTo(actualThisType, getInstantiatedSignatureThisType(sig, signatureThisType, actualThisType));
20399
- });
20400
- }
20401
- function getInstantiatedSignatureThisType(sig: Signature, signatureThisType: Type, actualThisType: Type): Type {
20402
- if (!sig.typeParameters) {
20403
- return signatureThisType;
20404
- }
20405
- const context = createInferenceContext(sig.typeParameters, sig, InferenceFlags.None);
20406
- inferTypes(context.inferences, actualThisType, signatureThisType);
20407
- return instantiateType(signatureThisType, createSignatureTypeMapper(sig, getInferredTypes(context)));
20389
+ return isValidPropertyAccessWithType(node, node.kind === SyntaxKind.PropertyAccessExpression && node.expression.kind === SyntaxKind.SuperKeyword, property.escapedName, type);
20390
+ // Previously we validated the 'this' type of methods but this adversely affected performance. See #31377 for more context.
20408
20391
}
20409
20392
20410
20393
function isValidPropertyAccessWithType(
0 commit comments