GeneratorFunction should not be newable

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

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

Từ ngày 4/12/2023.

Đánh giá

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

Mô tả

Needs Investigation
⚙ Compilation target

ES2015 ES2018

⚙ Library

generator asyncgenerator

Missing / Incorrect Definition

GeneratorFunction and AsyncGeneratorFunction (async function * () {}) should not be newable.

GeneratorFunction means function * () {} which is only callable, while GeneratorFunctionConstructor means function * () {}.constructor which is both callable and newable.

Sample Code
declare const gen: GeneratorFunction;
new gen;// there should cause a type error, but not
Documentation Link

No response

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

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.

Issue khác của microsoft/TypeScript

Tất cả issue của microsoft/TypeScript

Issue tương tự

Thêm issue về Go

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.