Skip to content

JsDoc for overloads #3294

Closed
Closed
@danmarshall

Description

@danmarshall

When adding JSDoc to an overloaded function, It seems that the JSDoc comment must immediately precede the actual function. When preceding the list of overloads, the JSDoc comment is dropped after compilation.

Example:

module app {

/**
 * Returns "foo"
 * 
 * this doesn't output.
 */
export function foo(x: string): string;
export function foo(x: number): string;
export function foo(x: any): string {
    return "foo";
}


export function bar(x: string): string;
export function bar(x: number): string;

/**
 * Returns "bar"
 * 
 * this will output. but I don't like my overloads detached.
 */
export function bar(x: any): string {
    return "bar";
}

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    By DesignDeprecated - use "Working as Intended" or "Design Limitation" instead

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions