Skip to content

Commit 75cb739

Browse files
committed
pass parameter type to assignBindingElementTypes
1 parent f4a5562 commit 75cb739

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

src/compiler/checker.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -26064,9 +26064,6 @@ namespace ts {
2606426064

2606526065
const contextualSignature = getContextualSignature(func);
2606626066
if (contextualSignature) {
26067-
// const inferenceContext = getInferenceContext(func); // >> Changed here
26068-
// const signature = inferenceContext ?
26069-
// instantiateSignature(contextualSignature, inferenceContext.mapper) : contextualSignature;
2607026067
const signature = contextualSignature;
2607126068
const index = func.parameters.indexOf(parameter) - (getThisParameter(func) ? 1 : 0);
2607226069
return parameter.dotDotDotToken && lastOrUndefined(func.parameters) === parameter ?
@@ -31873,9 +31870,8 @@ namespace ts {
3187331870
function assignBindingElementTypes(pattern: BindingPattern, parentType: Type) {
3187431871
for (const element of pattern.elements) {
3187531872
if (!isOmittedExpression(element)) {
31876-
const type = getBindingElementTypeFromParentType(element, parentType); // >> Changed here
31873+
const type = getBindingElementTypeFromParentType(element, parentType);
3187731874
if (element.name.kind === SyntaxKind.Identifier) {
31878-
// getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element);
3187931875
getSymbolLinks(getSymbolOfNode(element)).type = type;
3188031876
}
3188131877
else {

tests/cases/compiler/narrowingRestGenericCall.ts

-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ function call<T extends object>(obj: T, cb: (val: T) => void) {
1010
declare let obj: Slugs;
1111
call(obj, ({foo, ...rest}) => {
1212
console.log(rest.bar);
13-
// ~~~ Property 'bar' does not exist on type 'Omit<T, "foo">'. ts(2339)
1413
});

0 commit comments

Comments
 (0)