Microsoft/TypeScript
GitHub ã§èŠãtsc with allowJs reports TS9005 error for nested anonymous constructor functions
Open
#57,523 opened on 2024幎2æ24æ¥
Domain: Declaration EmitHelp WantedPossible Improvement
Repository metrics
- Stars
- Â (48,455 stars)
- PR merge metrics
-  (å¹³åããŒãž 6d 17h) (30d ã§ 9 merged PRs)
説æ
ð Search Terms
TS9005: Declaration emit for this file requires using private name '(Anonymous function)'. An explicit type annotation may unblock declaration emit.
ð Version & Regression Information
- Occurs on versions 3.7.5 - nightly
- Related to PR #55472
Related to #55172
When 2 separate nested this bindings are used within constructor functions, the following error's returned always at the top of the file (this was really annoying to debug ð
)
Declaration emit for this file requires using private name '(Anonymous function)'. An explicit type annotation may unblock declaration emit.
⯠Playground Link
ð» Code
const a = new function () {
this.b = new function () {
this.c = 1
}
}
ð Actual behavior
Complains
ð Expected behavior
Shouldn't complain
Additional information about the issue
No response