Skip to content

Commit 0199434

Browse files
committed
Higher order this parameter inference, like microsoft#31116
1 parent b968922 commit 0199434

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23736,7 +23736,7 @@ namespace ts {
2373623736
const thisType = getThisTypeOfSignature(signature);
2373723737
if (thisType) {
2373823738
const thisArgumentNode = getThisArgumentOfCall(node);
23739-
const thisArgumentType = thisArgumentNode ? checkExpression(thisArgumentNode) : voidType;
23739+
const thisArgumentType = thisArgumentNode ? checkExpressionWithContextualType(thisArgumentNode, thisType, context, checkMode) : voidType;
2374023740
inferTypes(context.inferences, thisArgumentType, thisType);
2374123741
}
2374223742

tests/baselines/reference/user/create-react-app.log

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Exit Code: 1
22
Standard output:
3-
test/fixtures/issue-5176-flow-class-properties/src/App.js(5,8): error TS8010: 'types' can only be used in a .ts file.
3+
test/fixtures/issue-5176-flow-class-properties/src/App.js(5,8): error TS8010: Type annotations can only be used in TypeScript files.
44
test/fixtures/issue-5176-flow-class-properties/src/App.js(5,13): error TS1005: ';' expected.
55
test/fixtures/webpack-message-formatting/src/AppBabel.js(6,8): error TS17008: JSX element 'div' has no corresponding closing tag.
66
test/fixtures/webpack-message-formatting/src/AppBabel.js(8,7): error TS17002: Expected corresponding JSX closing tag for 'span'.

0 commit comments

Comments
 (0)