Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

GeneratorFunction should not be newable #56645

Copy link
Copy link
@LongTengDao

Description

@LongTengDao
Issue body actions

⚙ 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

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.