Microsoft/TypeScript

Computed property type is invalid in type emitted if it is a unique symbol coming from a property that has a space in the name

開放

#60,823 建立於 2024年12月19日

 (1 則留言) (0 個反應) (0 位負責人)TypeScript (13,395 個分叉)batch import
BugDomain: Declaration EmitHelp Wanted

倉庫指標

星標
 (108,860 顆星)
PR 合併指標
 (平均合併 6天 17小時) (30 天內合併 9 個 PR)

描述

🔎 Search Terms

computed property unique symbols declaration emit

🕗 Version & Regression Information

  • This changed between versions 3.7 and 3.8

⏯ Playground Link

Playground Link

💻 Code

class T {
    static readonly ['A a']: unique symbol;
}
let x = {
    foo:T['A a']
} as const;

🙁 Actual behavior

The type of x is emitted as { readonly foo: typeof T.A a; } which is invlaid.

🙂 Expected behavior

Declaration emit should be valid

Additional information about the issue

No response

貢獻者指南