Skip to content

Commit

Permalink
Higher order this parameter inference, like microsoft#31116
Browse files Browse the repository at this point in the history
  • Loading branch information
jablko committed Nov 26, 2019
1 parent d3855d6 commit 62ac294
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Expand Up @@ -23725,7 +23725,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);
}

Expand Down
2 changes: 1 addition & 1 deletion 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'.
Expand Down
8 changes: 8 additions & 0 deletions tests/baselines/reference/user/npm.log
Expand Up @@ -925,6 +925,14 @@ node_modules/npm/lib/whoami.js(18,18): error TS2339: Property 'config' does not
node_modules/npm/lib/whoami.js(24,18): error TS2339: Property 'registry' does not exist on type 'typeof EventEmitter'.
node_modules/npm/lib/whoami.js(30,26): error TS2339: Property 'code' does not exist on type 'Error'.
node_modules/npm/lib/whoami.js(45,12): error TS2339: Property 'code' does not exist on type 'Error'.
node_modules/npm/scripts/index-build.js(20,13): error TS2531: Object is possibly 'null'.
node_modules/npm/scripts/index-build.js(20,22): error TS2531: Object is possibly 'null'.
node_modules/npm/scripts/index-build.js(21,30): error TS2531: Object is possibly 'null'.
node_modules/npm/scripts/index-build.js(22,29): error TS2531: Object is possibly 'null'.
node_modules/npm/scripts/index-build.js(23,15): error TS2531: Object is possibly 'null'.
node_modules/npm/scripts/index-build.js(23,22): error TS2531: Object is possibly 'null'.
node_modules/npm/scripts/index-build.js(24,15): error TS2531: Object is possibly 'null'.
node_modules/npm/scripts/index-build.js(24,22): error TS2531: Object is possibly 'null'.
node_modules/npm/scripts/publish-tag.js(2,36): error TS2732: Cannot find module '../package.json'. Consider using '--resolveJsonModule' to import module with '.json' extension
node_modules/npm/test/broken-under-nyc-and-travis/lifecycle-path.js(7,20): error TS2307: Cannot find module 'tap'.
node_modules/npm/test/broken-under-nyc-and-travis/lifecycle-path.js(18,23): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
Expand Down

0 comments on commit 62ac294

Please sign in to comment.