microsoft / microsoft/TypeScript

Typedef of object with generic property fails since 5.1

Offen
#54,544 4 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@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

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.