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

Open

#60.823 aberto em 19 de dez. de 2024

Ver no GitHub
 (1 comment) (0 reactions) (0 assignees)TypeScript (6.726 forks)batch import
BugDomain: Declaration EmitHelp Wanted

Métricas do repositório

Stars
 (48.455 stars)
Métricas de merge de PR
 (Mesclagem média 6d 17h) (9 fundiu PRs em 30d)

Description

🔎 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

Guia do colaborador