microsoft / microsoft/TypeScript
fixUnusedIdentifier may remove a used side-effect
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
TypeScript Version: 2.9.0-dev.20180506
Code
{ const x = launchMissiles(); }
Expected behavior:
const x = removed, and missiles still launched.
Actual behavior:
Missiles unlaunched.
Unfortunately we have no way of knowing whether a function call does have side effects (#17181), so doing this in general might be annoying as users have to manually delete function calls with unused results.
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 by locating the fixUnusedIdentifier entry point and reproduce the issue with the provided { const x = launchMissiles(); } example. Determine how unused identifiers are removed while preserving the function call's possible side effect, and verify that the compiled output still launches the missiles.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100