Skip to content

Commit 90667e1

Browse files
committed
Remove this-parameter filtering in statement completion
1 parent 5460281 commit 90667e1

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20386,25 +20386,7 @@ namespace ts {
2038620386
}
2038720387

2038820388
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);
2040820390
}
2040920391

2041020392
function isValidPropertyAccessWithType(

0 commit comments

Comments
 (0)