You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
declareconstgen: GeneratorFunction;newgen;// there should cause a type error, but not
⚙ Compilation target
ES2015 ES2018
⚙ Library
generator asyncgenerator
Missing / Incorrect Definition
GeneratorFunctionandAsyncGeneratorFunction(async function * () {}) should not be newable.GeneratorFunctionmeansfunction * () {}which is only callable, whileGeneratorFunctionConstructormeansfunction * () {}.constructorwhich is both callable and newable.Sample Code
Documentation Link
No response