microsoft / microsoft/TypeScript
Transpilation of iterable spread is incorrect for non-iterable values.
Open
@rbuckton is already working on this.
Since Mar 23, 2021.
Needs Investigation
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
Bug Report
🔎 Search Terms
transpilation __spreadArray spread iterable
🕗 Version & Regression Information
- This changed between versions 4.1 and 4.2, but was broken in a different way in 4.1
⏯ Playground Link
https://www.typescriptlang.org/play?target=1&ts=4.2.3#code/MYewdgziA2CmB00QHMAUBteWCMBdAlANxA
💻 Code
console.log([...1]);
🙁 Actual behavior
print []
🙂 Expected behavior
Throw a runtime exception. 1 is not an iterable.
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.
Assessment
This issue has not been assessed yet.