Microsoft/TypeScript
Ver no GitHub`--isolatedDeclarations` allows generator functions
Open
#58.334 aberto em 26 de abr. de 2024
BugDomain: flag: isolatedDeclarationsHelp Wanted
Métricas do repositório
- Stars
- (48.455 stars)
- Métricas de merge de PR
- (Mesclagem média 6d 17h) (9 fundiu PRs em 30d)
Description
🔎 Search Terms
- generator functions
- isolated declartions
- yield
🕗 Version & Regression Information
5.5.0-dev.20240426
⏯ Playground Link
💻 Code
export function* asd() {
yield 2;
yield 3;
return 1
}
🙁 Actual behavior
This is allowed, the following code is emitted even though it requires inference:
export declare function asd(): Generator<2 | 3, number, unknown>;
🙂 Expected behavior
This is disallowed (probably all generator functions)
Additional information about the issue
cc @dragomirtitian