microsoft / microsoft/TypeScript
Version 5.0.4 -> 5.1.3 Regression when using generic types
Offen
@weswigham arbeitet bereits daran.
Seit 28.6.2023.
Bug
Domain: check: Type Inference
Rescheduled
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.4k
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 117
Beschreibung
Bug Report
🔎 Search Terms
Generic, 5.1.3
🕗 Version & Regression Information
- This changed between versions 5.0.4 and 5.1.3
⏯ Playground Link
💻 Code
type LexicalCommand<TPayload> = Record<string, never>;
type InsertTextPayload = Readonly<{ text: string }>;
function createCommand<T>(): LexicalCommand<T> {
return {};
}
const INSERT_TEXT_COMMAND: LexicalCommand<InsertTextPayload> =
createCommand();
🙁 Actual behavior
The type of INSERT_TEXT_COMMAND is LexicalCommand<TPayload> in 5.1.3 (but LexicalCommand<InsertTextPayload> in 5.0.4).
🙂 Expected behavior
The type of INSERT_TEXT_COMMAND should be LexicalCommand<InsertTextPayload>.
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.