TypeScript/tests/cases/fourslash/annotateWithTypeFromJSDoc8.ts
Nathan Shively-Sanders 4cb210ce2e
Parameters infer from body and call sites (#28342)
* Parameters infer from body usage and call sites

* Function expressions infer from variable decl usages

If the function expression is the initialiser of a variable declaration.

* Update isApplicableFunctionForInference too

* Update baseline
2018-11-05 11:29:16 -08:00

23 lines
368 B
TypeScript

/// <reference path='fourslash.ts' />
/////**
//// * @param {number} x
//// * @returns {number}
//// */
////var f = function (x) {
//// return x
////}
verify.codeFix({
description: "Annotate with type from JSDoc",
index: 0,
newFileContent:
`/**
* @param {number} x
* @returns {number}
*/
var f = function (x: number): number {
return x
}`,
});