Microsoft/TypeScript
GitHub ã§èŠãNo report of implicit any type in a generator when destructuring
Open
#43,172 opened on 2021幎3æ10æ¥
BugDomain: check: Type InferenceHelp Wanted
Repository metrics
- Stars
- Â (48,455 stars)
- PR merge metrics
-  (å¹³åããŒãž 6d 17h) (30d ã§ 9 merged PRs)
説æ
Bug Report
ð Search Terms
no implicit any, generator, yield, destructure #41348 - Report implicit any error for 'yield' result with no contextual type
ð Version & Regression Information
TypeScript 4.2.3
⯠Playground Link
Playground link with relevant code
ð» Code
function* sample() {
const a = yield 1 // error, as expected, a is implicitly any
const { b } = yield 1 // no error, but expected, b is implicitly any
const [c] = yield 1 // no error, but expected, c is implicitly any
}
ð Actual behavior
b, c implicitly have type any, but no error reported
ð Expected behavior
Errors reported