microsoft / microsoft/TypeScript
No report of implicit any type in a generator when destructuring
Open
Nobody has claimed this yet.
Bug
Domain: check: Type Inference
Help Wanted
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked TypeScript Playground example and trace how the checker handles implicit-any diagnostics for destructuring assignments from a generator yield. Done means the sample reports errors for both destructured variables b and c, while preserving the existing diagnostic for a.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100