Skip to content

Overloads do not emit JSDoc on non-implementation signatures #27981

Open
@bluelovers

Description

@bluelovers

TypeScript Version: 3.2.0-dev.201xxxxx

Search Terms:

Code

.ts file

/**
 * this will lost
 */
function a()
function a() { }

/**
 * this will keep
 */
function b() { }

function c()
/**
 * this will keep, but i don't think this is good way
 */
function c() { }

Expected behavior:

all will keep

/**
 * this will lost
 */
function a() { }
/**
 * this will keep
 */
function b() { }
/**
 * this will keep, but i don't think this is good way
 */
function c() { }

Actual behavior:

a is lost

output .js file

function a() { }
/**
 * this will keep
 */
function b() { }
/**
 * this will keep, but i don't think this is good way
 */
function c() { }

and when it at .d.ts

  • a will keep
  • b will keep too
  • but c will lost

Playground Link:
http://www.typescriptlang.org/play/index.html#src=%2F**%0D%0A%20*%20this%20will%20lost%0D%0A%20*%2F%0D%0Afunction%20a()%0D%0Afunction%20a()%20%7B%20%7D%0D%0A%0D%0A%2F**%0D%0A%20*%20this%20will%20keep%0D%0A%20*%2F%0D%0Afunction%20b()%20%7B%20%7D%0D%0A%0D%0Afunction%20c()%0D%0A%2F**%0D%0A%20*%20this%20will%20keep%2C%20but%20i%20don%27t%20think%20this%20is%20good%20way%0D%0A%20*%2F%0D%0Afunction%20c()%20%7B%20%7D

Related Issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: Comment EmitThe issue relates to the emission of comments when compilingExperience EnhancementNoncontroversial enhancementsSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions