microsoft / microsoft/TypeScript

Typedef of object with generic property fails since 5.1

Đang mở
#54,544 4 bình luận 0 reaction 1 người được giao Xem trên GitHub

@sandersn đang làm issue này rồi.

Từ ngày 12/6/2023.

Needs Investigation
Ngôn ngữ chính
Go
Star
111k
Fork
14.4k
Merge trung bình
1 ngày 19 giờ
Pull request đã merge (30 ngày)
117

Mô tả

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
 */

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.