From 0199434a5017d26ed9a9b8f38da98c12ac7c5f2f Mon Sep 17 00:00:00 2001 From: Jack Bates Date: Wed, 28 Aug 2019 16:18:51 -0700 Subject: [PATCH] Higher order this parameter inference, like #31116 --- src/compiler/checker.ts | 2 +- tests/baselines/reference/user/create-react-app.log | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 6b64f6dfe7d1b..5eda99b324948 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -23736,7 +23736,7 @@ namespace ts { const thisType = getThisTypeOfSignature(signature); if (thisType) { const thisArgumentNode = getThisArgumentOfCall(node); - const thisArgumentType = thisArgumentNode ? checkExpression(thisArgumentNode) : voidType; + const thisArgumentType = thisArgumentNode ? checkExpressionWithContextualType(thisArgumentNode, thisType, context, checkMode) : voidType; inferTypes(context.inferences, thisArgumentType, thisType); } diff --git a/tests/baselines/reference/user/create-react-app.log b/tests/baselines/reference/user/create-react-app.log index 4ce65c3b59abe..d2ccce82e6a10 100644 --- a/tests/baselines/reference/user/create-react-app.log +++ b/tests/baselines/reference/user/create-react-app.log @@ -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'.