TypeScript/tests/cases/fourslash/codeFixInferFromFunctionThisUsageObjectPropertyShorthand.ts
Josh Goldberg ca00b3248b Added --noImplicitThis code fix for functions used as object properties (#31138)
* Added --noImplicitThis code fix for functions used as object properties

Before trying out all the various possibilities for where these functions could be used, I figured I'd start out with a relatively simple use case to verify this is the right approach. Is it? 😄

Starts on #28964.

* Fixed function expression names; included new baselines

* Got JSDocs to work, hooray!

* Added test for 'any' case of no function uses

* Refactored for inferFunctionReferencesFromUsage

* Fixed inference bug: undefined references cause parameters to default

* Removed dead code comments
2019-06-17 19:00:15 -07:00

21 lines
429 B
TypeScript

/// <reference path='fourslash.ts' />
// @noImplicitThis: true
////function returnThisMember([| |]) {
//// return this.member;
//// }
////
//// interface Container {
//// member: string;
//// returnThisMember(): string;
//// }
////
//// const container: Container = {
//// member: "sample",
//// returnThisMember,
//// };
////
//// container.returnThisMember();
verify.rangeAfterCodeFix("this: Container");