microsoft / microsoft/TypeScript
GeneratorFunction should not be newable
Offen
@rbuckton arbeitet bereits daran.
Seit 04.12.2023.
Needs Investigation
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.4k
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 117
Beschreibung
⚙ 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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Bewertung
Dieses Issue wurde noch nicht bewertet.