Closed
Description
Search terms
Anonymous function, function return, currying, inherit
Expected Behavior
When a class method returns an anonymous function, the anonymous function should either have no documentation (besides the method's @return
annotation) or its own documentation.
Actual Behavior
When a class method returns an anonymous function, the anonymous function copies the method's docs.
Example code:
export class ClassVersion {
/**
* This is the outer function.
*
* @returns The inner function.
*/
outer(): () => void {
/** Docs for the inner function? */
return () => {};
}
}
Steps to reproduce the bug
https://github.com/mweidner037/mwe-typedoc-returned-function
Environment
- Typedoc version: 0.24.8
- TypeScript version: 5.1.6
- Node.js version: 16.13.1
- OS: Ubuntu 22.04
More info
If the outer function is a standalone function instead of a class method, it behaves as I would expect:
/**
* This is the outer function.
*
* @returns The inner function.
*/
export function outerAsFunction(): () => void {
/** Docs for the inner function? */
return () => {};
}
Generated docs:
Potentially related issue: #2283 (comment)
Metadata
Metadata
Assignees
Labels
No labels