Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile time exponentially longer as more exclamation marks are added to a negation in a template placeholder expression #39018

Open
eriklumme opened this issue Jun 11, 2020 · 0 comments
Labels
Bug A bug in TypeScript
Milestone

Comments

@eriklumme
Copy link

TypeScript Version: 3.9.5

Search Terms: exponential, exclamation, negation

Code

let a = `${!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!true}`

Expected behavior:

The compile time does not exponentially increase as more exclamation marks are added.

Actual behavior:

The compile time increases exponentially with more exclamation marks.

Playground Link:

https://www.typescriptlang.org/play/#code/DYUwLgBAhhC8EAMAkBvAhBzXs7QMymAGcQBfBAbgFgAoQkAJzAAooBKamoA

It will always say that the code ran immediately, but after changing the code, the result will be incorrect for some time. In addition, you will notice as you add more exclamation marks that it takes a long time for whatever you write on the left side to appear on the right.

Related Issues:

@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Jun 11, 2020
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Jun 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript
Projects
None yet
Development

No branches or pull requests

2 participants