pass parameter type to assignBindingElementTypes

This commit is contained in:
Gabriela Araujo Britto
2022-02-15 11:23:29 -08:00
parent f4a5562543
commit 75cb7392f3
2 changed files with 1 additions and 6 deletions
+1 -5
View File
@@ -26064,9 +26064,6 @@ namespace ts {
const contextualSignature = getContextualSignature(func);
if (contextualSignature) {
// const inferenceContext = getInferenceContext(func); // >> Changed here
// const signature = inferenceContext ?
// instantiateSignature(contextualSignature, inferenceContext.mapper) : contextualSignature;
const signature = contextualSignature;
const index = func.parameters.indexOf(parameter) - (getThisParameter(func) ? 1 : 0);
return parameter.dotDotDotToken && lastOrUndefined(func.parameters) === parameter ?
@@ -31873,9 +31870,8 @@ namespace ts {
function assignBindingElementTypes(pattern: BindingPattern, parentType: Type) {
for (const element of pattern.elements) {
if (!isOmittedExpression(element)) {
const type = getBindingElementTypeFromParentType(element, parentType); // >> Changed here
const type = getBindingElementTypeFromParentType(element, parentType);
if (element.name.kind === SyntaxKind.Identifier) {
// getSymbolLinks(getSymbolOfNode(element)).type = getTypeForBindingElement(element);
getSymbolLinks(getSymbolOfNode(element)).type = type;
}
else {
@@ -10,5 +10,4 @@ function call<T extends object>(obj: T, cb: (val: T) => void) {
declare let obj: Slugs;
call(obj, ({foo, ...rest}) => {
console.log(rest.bar);
// ~~~ Property 'bar' does not exist on type 'Omit<T, "foo">'. ts(2339)
});