ca00b3248b
* 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
23 lines
541 B
TypeScript
23 lines
541 B
TypeScript
/// <reference path='fourslash.ts' />
|
|
|
|
// @noImplicitThis: true
|
|
//// const returnThisMember = function ([| |]) {
|
|
//// return this.member;
|
|
//// }
|
|
////
|
|
//// interface Container {
|
|
//// member: string;
|
|
//// returnThisMember(): string;
|
|
//// }
|
|
////
|
|
//// const container: Container = {
|
|
//// member: "sample",
|
|
//// returnThisMember: returnThisMember,
|
|
//// };
|
|
|
|
verify.codeFix({
|
|
description: "Infer 'this' type of 'returnThisMember' from usage",
|
|
index: 0,
|
|
newRangeContent: "this: Container ",
|
|
});
|