Skip to content

Fixed accidental possibility to create Infinity/-Infinity number literal types - #56301

Closed
Mateusz Burzyński (Andarist) wants to merge 1 commit into
microsoft:mainfrom
Andarist:no-infinity-number-literals
Closed

Fixed accidental possibility to create Infinity/-Infinity number literal types#56301
Mateusz Burzyński (Andarist) wants to merge 1 commit into
microsoft:mainfrom
Andarist:no-infinity-number-literals

Conversation

@Andarist

Copy link
Copy Markdown
Contributor

closes#56272

While there are some issues open about allowing those in some form, I think that - for the time being - the fact that they can be constructed (somewhat) should be considered a bug.

@typescript-botTypeScript Bot (typescript-bot) added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Nov 3, 2023
@typescript-bot

Copy link
Copy Markdown
Contributor

The TypeScript team hasn't accepted the linked issue #56272. If you can get it accepted, this PR will have a better chance of being reviewed.

@jakebailey

Copy link
Copy Markdown
Member

@typescript-bot

TypeScript Bot (typescript-bot) commented Nov 13, 2023

Copy link
Copy Markdown
Contributor

Heya Jake Bailey (@jakebailey), I've started to run the diff-based user code test suite on this PR at e56d3c9. You can monitor the build here.

Update: The results are in!

@typescript-bot

TypeScript Bot (typescript-bot) commented Nov 13, 2023

Copy link
Copy Markdown
Contributor

Heya Jake Bailey (@jakebailey), I've started to run the diff-based top-repos suite on this PR at e56d3c9. You can monitor the build here.

Update: The results are in!

@typescript-bot

TypeScript Bot (typescript-bot) commented Nov 13, 2023

Copy link
Copy Markdown
Contributor

Heya Jake Bailey (@jakebailey), I've started to run the tarball bundle task on this PR at e56d3c9. You can monitor the build here.

@typescript-bot

TypeScript Bot (typescript-bot) commented Nov 13, 2023

Copy link
Copy Markdown
Contributor

Heya Jake Bailey (@jakebailey), I've started to run the regular perf test suite on this PR at e56d3c9. You can monitor the build here.

Update: The results are in!

@typescript-bot

TypeScript Bot (typescript-bot) commented Nov 13, 2023

Copy link
Copy Markdown
Contributor

Heya Jake Bailey (@jakebailey), I've started to run the parallelized Definitely Typed test suite on this PR at e56d3c9. You can monitor the build here.

Update: The results are in!

@typescript-bot

TypeScript Bot (typescript-bot) commented Nov 13, 2023

Copy link
Copy Markdown
Contributor

Hey Jake Bailey (@jakebailey), I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
"devDependencies": {
"typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/158562/artifacts?artifactName=tgz&fileId=9871919655992580B3C2C5C2A0869800491FAAC90E99AFFD7550D5FCCA784BAE02&fileName=/typescript-5.4.0-insiders.20231113.tgz"
}
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@5.4.0-pr-56301-7".;

@typescript-bot

Copy link
Copy Markdown
Contributor

Jake Bailey (@jakebailey) Here are the results of running the user test suite comparing main and refs/pull/56301/merge:

There were infrastructure failures potentially unrelated to your change:

  • 2 instances of "Package install failed"

Otherwise...

Something interesting changed - please have a look.

Details

puppeteer

packages/browsers/test/src/tsconfig.json

@typescript-bot

Copy link
Copy Markdown
Contributor

Jake Bailey (@jakebailey)
The results of the perf run you requested are in!

Here they are:

Compiler

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Angular - node (v18.15.0, x64)
Memory used295,164k (± 0.01%)295,173k (± 0.02%)~295,127k295,245kp=1.000 n=6
Parse Time2.63s (± 0.47%)2.64s (± 0.46%)~2.62s2.65sp=0.187 n=6
Bind Time0.83s (± 0.62%)0.84s (± 0.97%)~0.83s0.85sp=0.523 n=6
Check Time8.03s (± 0.27%)8.02s (± 0.21%)~7.99s8.04sp=0.460 n=6
Emit Time7.09s (± 0.19%)7.08s (± 0.30%)~7.05s7.11sp=0.568 n=6
Total Time18.58s (± 0.17%)18.57s (± 0.15%)~18.53s18.60sp=0.518 n=6
Compiler-Unions - node (v18.15.0, x64)
Memory used193,594k (± 1.64%)192,649k (± 1.56%)~190,668k196,557kp=1.000 n=6
Parse Time1.35s (± 0.73%)1.34s (± 1.02%)~1.32s1.36sp=0.720 n=6
Bind Time0.73s (± 0.00%)0.73s (± 0.00%)~0.73s0.73sp=1.000 n=6
Check Time9.16s (± 0.16%)9.18s (± 0.15%)~9.16s9.19sp=0.161 n=6
Emit Time2.63s (± 0.67%)2.62s (± 0.61%)~2.61s2.65sp=0.506 n=6
Total Time13.87s (± 0.12%)13.88s (± 0.19%)~13.83s13.90sp=0.258 n=6
Monaco - node (v18.15.0, x64)
Memory used347,343k (± 0.00%)347,364k (± 0.00%)+21k (+ 0.01%)347,355k347,374kp=0.031 n=6
Parse Time2.45s (± 0.92%)2.47s (± 0.34%)~2.45s2.47sp=0.458 n=6
Bind Time0.94s (± 0.43%)0.94s (± 0.55%)~0.94s0.95sp=0.595 n=6
Check Time6.93s (± 0.53%)6.93s (± 0.37%)~6.89s6.96sp=0.809 n=6
Emit Time4.04s (± 0.21%)4.04s (± 0.00%)~4.04s4.04sp=0.121 n=6
Total Time14.37s (± 0.24%)14.37s (± 0.17%)~14.34s14.40sp=0.936 n=6
TFS - node (v18.15.0, x64)
Memory used302,581k (± 0.01%)302,608k (± 0.01%)~302,581k302,672kp=0.066 n=6
Parse Time2.01s (± 0.49%)2.00s (± 0.97%)~1.97s2.03sp=0.548 n=6
Bind Time1.00s (± 0.41%)1.00s (± 1.03%)~0.99s1.02sp=0.924 n=6
Check Time6.25s (± 0.43%)6.27s (± 0.25%)~6.25s6.29sp=0.328 n=6
Emit Time3.58s (± 0.38%)3.59s (± 0.64%)~3.56s3.62sp=0.807 n=6
Total Time12.85s (± 0.20%)12.86s (± 0.26%)~12.82s12.90sp=0.466 n=6
material-ui - node (v18.15.0, x64)
Memory used470,570k (± 0.00%)470,577k (± 0.00%)~470,558k470,590kp=0.514 n=6
Parse Time2.56s (± 0.38%)2.57s (± 0.29%)~2.56s2.58sp=0.300 n=6
Bind Time0.99s (± 1.05%)1.00s (± 0.75%)~0.99s1.01sp=0.063 n=6
Check Time16.64s (± 0.30%)16.66s (± 0.43%)~16.56s16.77sp=0.521 n=6
Emit Time0.00s (± 0.00%)0.00s (± 0.00%)~0.00s0.00sp=1.000 n=6
Total Time20.18s (± 0.22%)20.23s (± 0.34%)~20.13s20.33sp=0.230 n=6
xstate - node (v18.15.0, x64)
Memory used512,817k (± 0.01%)512,811k (± 0.01%)~512,759k512,863kp=0.688 n=6
Parse Time3.27s (± 0.46%)3.27s (± 0.42%)~3.25s3.29sp=0.933 n=6
Bind Time1.54s (± 0.33%)1.55s (± 0.33%)~1.54s1.55sp=0.311 n=6
Check Time2.86s (± 0.14%)2.86s (± 0.78%)~2.83s2.89sp=1.000 n=6
Emit Time0.08s (± 4.99%)0.08s (± 6.19%)~0.08s0.09sp=0.595 n=6
Total Time7.75s (± 0.11%)7.75s (± 0.49%)~7.69s7.80sp=0.745 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Angular - node (v18.15.0, x64)
  • Compiler-Unions - node (v18.15.0, x64)
  • Monaco - node (v18.15.0, x64)
  • TFS - node (v18.15.0, x64)
  • material-ui - node (v18.15.0, x64)
  • xstate - node (v18.15.0, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

tsserver

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Compiler-UnionsTSServer - node (v18.15.0, x64)
Req 1 - updateOpen2,383ms (± 1.19%)2,374ms (± 0.50%)~2,357ms2,390msp=0.261 n=6
Req 2 - geterr5,378ms (± 1.43%)5,424ms (± 1.35%)~5,317ms5,481msp=0.471 n=6
Req 3 - references328ms (± 0.69%)327ms (± 0.47%)~325ms329msp=0.807 n=6
Req 4 - navto277ms (± 1.06%)275ms (± 1.09%)~273ms279msp=0.546 n=6
Req 5 - completionInfo count1,356 (± 0.00%)1,356 (± 0.00%)~1,3561,356p=1.000 n=6
Req 5 - completionInfo80ms (± 7.49%)85ms (± 8.79%)~75ms90msp=0.315 n=6
CompilerTSServer - node (v18.15.0, x64)
Req 1 - updateOpen2,508ms (± 0.67%)2,509ms (± 1.44%)~2,458ms2,556msp=0.873 n=6
Req 2 - geterr4,082ms (± 1.92%)4,134ms (± 1.92%)~4,031ms4,193msp=0.173 n=6
Req 3 - references342ms (± 1.19%)337ms (± 1.58%)~333ms344msp=0.123 n=6
Req 4 - navto282ms (± 0.29%)282ms (± 0.29%)~281ms283msp=0.204 n=6
Req 5 - completionInfo count1,518 (± 0.00%)1,518 (± 0.00%)~1,5181,518p=1.000 n=6
Req 5 - completionInfo88ms (± 5.50%)82ms (± 7.23%)~78ms90msp=0.262 n=6
xstateTSServer - node (v18.15.0, x64)
Req 1 - updateOpen2,602ms (± 0.41%)2,591ms (± 0.18%)~2,583ms2,597msp=0.109 n=6
Req 2 - geterr1,729ms (± 1.89%)1,713ms (± 2.42%)~1,670ms1,772msp=0.810 n=6
Req 3 - references111ms (± 8.51%)113ms (± 8.43%)~100ms123msp=0.936 n=6
Req 4 - navto365ms (± 0.41%)366ms (± 0.56%)~364ms369msp=0.510 n=6
Req 5 - completionInfo count2,073 (± 0.00%)2,073 (± 0.00%)~2,0732,073p=1.000 n=6
Req 5 - completionInfo316ms (± 1.13%)309ms (± 1.67%)-7ms (- 2.27%)303ms315msp=0.019 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • CompilerTSServer - node (v18.15.0, x64)
  • Compiler-UnionsTSServer - node (v18.15.0, x64)
  • xstateTSServer - node (v18.15.0, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Startup

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
tsc-startup - node (v18.15.0, x64)
Execution time152.31ms (± 0.22%)152.22ms (± 0.19%)-0.09ms (- 0.06%)151.08ms154.28msp=0.001 n=600
tsserver-startup - node (v18.15.0, x64)
Execution time228.30ms (± 0.16%)227.94ms (± 0.14%)-0.36ms (- 0.16%)226.56ms230.50msp=0.000 n=600
tsserverlibrary-startup - node (v18.15.0, x64)
Execution time229.21ms (± 0.17%)229.23ms (± 0.16%)~227.80ms235.82msp=0.527 n=600
typescript-startup - node (v18.15.0, x64)
Execution time228.95ms (± 0.14%)228.92ms (± 0.15%)~227.37ms231.91msp=0.165 n=600
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • tsc-startup - node (v18.15.0, x64)
  • tsserver-startup - node (v18.15.0, x64)
  • tsserverlibrary-startup - node (v18.15.0, x64)
  • typescript-startup - node (v18.15.0, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@typescript-bot

Copy link
Copy Markdown
Contributor

Hey Jake Bailey (@jakebailey), the results of running the DT tests are ready.
Everything looks the same!
You can check the log here.

@typescript-bot

Copy link
Copy Markdown
Contributor

Jake Bailey (@jakebailey) Here are the results of running the top-repos suite comparing main and refs/pull/56301/merge:

Everything looks good!

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Uncommitted BugPR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Infinities as number literal types

3 participants

@Andarist@typescript-bot@jakebailey