microsoft / microsoft/TypeScript
`keyof Readonly<string[]>` different from `keyof Readonly<T>` where T is string[]
Aperta
@ahejlsberg ci sta già lavorando.
Dal 16/10/2024.
Needs Investigation
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.4k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
🔎 Search Terms
keyof Readonly array
🕗 Version & Regression Information
Latest to date
⏯ Playground Link
💻 Code
type T1 = Readonly<string[]>; // readonly string[]
type R1 = keyof T1; // keyof readonly string[]
type KeyOfReadonly<T> = keyof Readonly<T>;
type R2 = KeyOfReadonly<string[]>; // ❌ keyof string[]
🙁 Actual behavior
doesn't work
🙂 Expected behavior
works
Additional information about the issue
What can I say, I really hope this is not the intended behavior.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Valutazione
Questa issue non è ancora stata valutata.