Skip to content

Commit

Permalink
Don't inferFromIndexTypes() twice
Browse files Browse the repository at this point in the history
  • Loading branch information
jablko committed Nov 22, 2019
1 parent db75d3c commit 6423e7f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17863,7 +17863,6 @@ namespace ts {
inferFromProperties(source, target);
inferFromSignatures(source, target, SignatureKind.Call);
inferFromSignatures(source, target, SignatureKind.Construct);
inferFromIndexTypes(source, target);
}
}

Expand Down Expand Up @@ -17901,6 +17900,7 @@ namespace ts {
inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp));
}
}
inferFromIndexTypes(source, target);
}

function inferFromSignatures(source: Type, target: Type, kind: SignatureKind) {
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/restTupleElements1.types
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ f0([]); // Error
>[] : never[]

f0([1]);
>f0([1]) : [number, number]
>f0([1]) : [number, unknown]
>f0 : <T, U>(x: [T, ...U[]]) => [T, U]
>[1] : [number]
>1 : 1
Expand Down
Loading

0 comments on commit 6423e7f

Please sign in to comment.