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 Oct 16, 2019
1 parent 77f4d9f commit 702f715
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17780,7 +17780,6 @@ namespace ts {
inferFromProperties(source, target);
inferFromSignatures(source, target, SignatureKind.Call);
inferFromSignatures(source, target, SignatureKind.Construct);
inferFromIndexTypes(source, target);
}
}

Expand Down Expand Up @@ -17818,6 +17817,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

0 comments on commit 702f715

Please sign in to comment.