4cb210ce2e
* 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
23 lines
368 B
TypeScript
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
|
|
}`,
|
|
});
|