Microsoft/TypeScript
GitHub ã§èŠã`--isolatedDeclarations` allows generator functions
Open
#58,334 opened on 2024幎4æ26æ¥
BugDomain: flag: isolatedDeclarationsHelp Wanted
Repository metrics
- Stars
- Â (48,455 stars)
- PR merge metrics
-  (å¹³åããŒãž 6d 17h) (30d ã§ 9 merged PRs)
説æ
ð 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