TypeScript/tests/cases/conformance/jsdoc/jsdocSignatureOnReturnedFunction.ts
Oleksandr T e87a0be959
fix(43444): add support JSDoc function signatures on returned function expressions (#43607)
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2021-04-13 16:11:58 -07:00

44 lines
743 B
TypeScript

// @allowJs: true
// @checkJs: true
// @target: esnext
// @noImplicitAny: true
// @declaration: true
// @outDir: out
// @Filename: jsdocSignatureOnReturnedFunction.js
function f1() {
/**
* @param {number} a
* @param {number} b
* @returns {number}
*/
return (a, b) => {
return a + b;
}
}
function f2() {
/**
* @param {number} a
* @param {number} b
* @returns {number}
*/
return function (a, b){
return a + b;
}
}
function f3() {
/** @type {(a: number, b: number) => number} */
return (a, b) => {
return a + b;
}
}
function f4() {
/** @type {(a: number, b: number) => number} */
return function (a, b){
return a + b;
}
}