microsoft / microsoft/TypeScript
duplicate comments on decorated fields
Open
Nobody has claimed this yet.
Bug
Domain: Comment Emit
Help Wanted
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 117
Description
🔎 Search Terms
typescript duplicate comments
🕗 Version & Regression Information
- This changed between versions ______ and _______
- This changed in commit or PR _______
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
- I was unable to test this on prior versions because _______
⏯ Playground Link
💻 Code
class SharedAPI {}
export class Scene extends SharedAPI {
/**
* @property {boolean} webgl -
*/
@booleanAttribute webgl = false
/**
* @property {boolean} foo -
*/
@booleanAttribute foo = false
}
🙁 Actual behavior
duplicate comments for the foo property appear in output
🙂 Expected behavior
No duplicate comments
Additional information about the issue
The output shows this:
constructor() {
super(...arguments);
/**
* @property {boolean} webgl -
*/
this.webgl = __runInitializers(this, _webgl_initializers, false
/**
* @property {boolean} foo -
*/
);
/**
* @property {boolean} foo -
*/
this.foo = (__runInitializers(this, _webgl_extraInitializers), __runInitializers(this, _foo_initializers, false));
__runInitializers(this, _foo_extraInitializers);
}
There's an extra @property {boolean} foo - comment in the output.
Similar issue:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked TypeScript Playground repro using target ES2022 and TypeScript 5.5.0-beta, then compare the emitted JavaScript for the decorated webgl and foo fields. The change is done when the foo property's JSDoc comment appears only once while the expected decorator initialization output remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100