-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationRelates to JSDoc parsing and type generationFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
TypeScript Version: 3.5.1
Search Terms:
JSDoc, duplicate, extends, implements
Code
interface InterfaceFoo<DataT extends { name : string }> {
/**
* Some comment
*
* -----
*/
name : DataT["name"]
}
class ClassFoo<DataT extends { name : string }> implements InterfaceFoo<DataT> {
name! : DataT["name"]
}
///////////////////////
declare const arr2 : readonly (
| ClassFoo<{name:"X"}>
| ClassFoo<{name:"Y"}>
)[];
/*
Expected:
Some comment
Actual:
Some comment
-----
Some comment
-----
*/
arr2[0].name
///////////////////////
declare const arr3 : readonly (
| ClassFoo<{name:"X"}>
| ClassFoo<{name:"Y"}>
| ClassFoo<{name:"Z"}>
)[];
/*
Expected:
Some comment
Actual:
Some comment
-----
Some comment
-----
Some comment
-----
*/
arr3[0].name
Expected behavior:
Some comment
should only appear once
Actual behavior:
Some comment
appears n
times if the array contains ClassFoo<>
n
times
Playground Link:
Related Issues:
No idea
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationRelates to JSDoc parsing and type generationFix AvailableA PR has been opened for this issueA PR has been opened for this issue