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

Expand Down Expand Up @@ -17962,6 +17961,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
2 changes: 1 addition & 1 deletion tests/baselines/reference/user/create-react-app.log
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Exit Code: 1
Standard output:
test/fixtures/issue-5176-flow-class-properties/src/App.js(5,8): error TS8010: 'types' can only be used in a .ts file.
test/fixtures/issue-5176-flow-class-properties/src/App.js(5,8): error TS8010: Type annotations can only be used in TypeScript files.
test/fixtures/issue-5176-flow-class-properties/src/App.js(5,13): error TS1005: ';' expected.
test/fixtures/webpack-message-formatting/src/AppBabel.js(6,8): error TS17008: JSX element 'div' has no corresponding closing tag.
test/fixtures/webpack-message-formatting/src/AppBabel.js(8,7): error TS17002: Expected corresponding JSX closing tag for 'span'.
Expand Down

0 comments on commit c75f2c8

Please sign in to comment.