microsoft / microsoft/TypeScript
`keyof Readonly<string[]>` different from `keyof Readonly<T>` where T is string[]
Offen
@ahejlsberg arbeitet bereits daran.
Seit 16.10.2024.
Needs Investigation
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.4k
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 117
Beschreibung
🔎 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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Bewertung
Dieses Issue wurde noch nicht bewertet.