Microsoft/TypeScript

duplicate comments on decorated fields

Open

#58,540 建立於 2024年5月14日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)TypeScript (6,726 fork)batch import
BugDomain: Comment EmitHelp Wanted

倉庫指標

Star
 (48,455 star)
PR 合併指標
 (平均合併 6天 17小時) (30 天內合併 9 個 PR)

描述

🔎 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

https://www.typescriptlang.org/play/?target=9&ts=5.5.0-beta#code/MYGwhgzhAEDKAWYBOBTAJgQQAoEloG8BfAKGJQA8AHAeyQBdpRIZZgUA7FaCujtFxKky4CxAJAB6AFRTx0KdAAClJNUop6ATwIAjatRAow7QtADuKHQHMQ0ALRypE8Yr0Gj7DHTpIAljoBXXnNLG2gAXmgAMzAQCBRiaGhpWTF5JRU1DTptfDdDY1Mo-XtHZzFXfQLPbz9A4OLqCOjY+OISIA

💻 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:

貢獻者指南