microsoft / microsoft/TypeScript
Typedef of object with generic property fails since 5.1
Offen
@sandersn arbeitet bereits daran.
Seit 12.6.2023.
Needs Investigation
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.4k
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 117
Beschreibung
Bug Report
🔎 Search Terms
generic typedef object
🕗 Version & Regression Information
- This changed between versions 5.0.4 and 5.1.3
⏯ Playground Link
Playground link with relevant code
💻 Code
/**
* @typedef {Object} O
* @property {Array<T>} a Array of T
* @template T
*/
🙁 Actual behavior
Templated properties produce an error since upgrading TS to 5.1.3
🙂 Expected behavior
Generic properties should work as in 5.0.4
This still works, but it should be functionally equivalent to the typedef above. Though the syntax with @property is preferable as each property can be documented with a description.
/**
* @typedef {{a: Array<T>}} O
* @template T
*/
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.