Skip to content

Fixed the issue with some longer variadic tuples with any rest being incorrectly assignable to shorter variadic tuples #50218

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

Conversation

Andarist
Copy link
Contributor

@Andarist Andarist commented Aug 8, 2022

fixes #50216

…g incorrectly assignable to shorter variadic tuples
@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Aug 8, 2022
Comment on lines +5694 to +5699
/** Number of required or variadic elements */
minLength: number;
/** Number of initial required or optional elements */
fixedLength: number;
/** True if tuple has any rest or variadic elements */
hasRestElement: boolean;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By moving those to JSDocs we improve slightly the IDE experience as this information gets displayed in the tooltips when hovering over those properties

const sourceIndex = i < targetArity - endCount ? i : i + sourceArity - targetArity;
const sourceFlags = isTupleType(source) && (i < startCount || i >= targetArity - endCount) ? source.target.elementFlags[sourceIndex] : ElementFlags.Rest;
const targetFlags = target.target.elementFlags[i];
for (let sourcePosition = 0; sourcePosition < sourceArity; sourcePosition++) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The core of the fix is in the iteration "style". Previously we were iterating over targetArity and "slicing" a source in the position of the target rest element.

When we consider the added test case:

declare let tt3: [number, string, ...any[]]
let tt4: [number, ...number[]] = tt3

It means that for the target's ...number[] we were creating a slice from those elements: string, ...any[]. This, in turn, was indexed~/unionized and thus became string | any which is just an equivalent of any. And that was used as a source type for the target, introducing a bug.

I've flipped this and now this loop iterates over sourceArity. This ensures that a specific position in the source is assignable, in "isolation", to the respective target position.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From testing this code with some examples and carefully reading through it, I think it's at least as correct as before (and more, now that it fixes the bug). I still need to review the error messages though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for the review! I know that there are some changes in the error messages and stuff - just want to let you know that I would happily make any required adjustments to this PR, but when it comes to those error messages I need to know what would be the expected results. IIRC the current messages are not incorrect - but perhaps you'd like to have them improved somehow.

@@ -18,12 +18,10 @@ tests/cases/conformance/types/tuple/restTupleElements1.ts(33,31): error TS2344:
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/types/tuple/restTupleElements1.ts(34,31): error TS2344: Type '[number, number, string]' does not satisfy the constraint '[number, ...number[]]'.
Type at positions 1 through 2 in source is not compatible with type at position 1 in target.
Type 'string | number' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number'.
Type 'string' is not assignable to type 'number'.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A change like this is correct with the new logic. As mentioned in the other comment - I no longer create unions from "tuple slices". That's why the reported source is just a "single" type here and not a union.

I think that perhaps this error could be somehow improved/rephrased cause it mentions a position span in the source where in fact the type mismatch happens only on a given position (or only on some positions of this span). The mentioned span covers all of the positions in the source that must match a single position of the rest in the target.

Note though that reporting a single type here is not completely new, this could always happen in cases like this:

declare let tt3: [number, string, ...string[]];
let tt4: [number, ...number[]] = tt3; 
// Type '[number, string, ...string[]]' is not assignable to type '[number, ...number[]]'.
//   Type at positions 1 through 2 in source is not compatible with type at position 1 in target.
//     Type 'string' is not assignable to type 'number'.(2322) 

I think there is a potential of just dropping this specific error:
https://github.com/microsoft/TypeScript/pull/50218/files#diff-d9ab6589e714c71e657f601cf30ff51dfc607fc98419bf72e04f6b0fa92cc4b8R20329
in favor of the existing simpler one:
https://github.com/microsoft/TypeScript/pull/50218/files#diff-d9ab6589e714c71e657f601cf30ff51dfc607fc98419bf72e04f6b0fa92cc4b8R20332

I've decided not to introduce this change here to limit the scope of the PR and to minimize the initial diff to make it easier to review it.

Comment on lines +203 to +205
!!! error TS2322: Type 'T' is not assignable to type 'number[]'.
!!! error TS2322: Type 'unknown[]' is not assignable to type 'number[]'.
!!! error TS2322: Type 'unknown' is not assignable to type 'number'.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell this is still correct, the reported error is now slightly different cause of the change in the logic (position by position comparison instead of comparing an indexed slice of the source to the target type)

@sandersn sandersn requested a review from ahejlsberg August 17, 2022 22:51
@typescript-bot typescript-bot added For Backlog Bug PRs that fix a backlog bug and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Aug 17, 2022
@sandersn sandersn requested a review from gabritto August 17, 2022 22:52
Copy link
Member

@gabritto gabritto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@@ -94,14 +92,12 @@ tests/cases/conformance/types/tuple/restTupleElements1.ts(59,4): error TS2345: A
~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2344: Type '[number, number, string]' does not satisfy the constraint '[number, ...number[]]'.
!!! error TS2344: Type at positions 1 through 2 in source is not compatible with type at position 1 in target.
!!! error TS2344: Type 'string | number' is not assignable to type 'number'.
!!! error TS2344: Type 'string' is not assignable to type 'number'.
!!! error TS2344: Type 'string' is not assignable to type 'number'.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with that change. The message could be better, because what ultimately fails is the type at position 2 in source, so we could be more specific. But considering we had the same problem before this PR, it seems out of scope for this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could improve on this error message here or in a followup PR - I would need a confirmation on how this should be reported though. I guess that in this case, I should drop the "positions X through Y" bit and just report this error for the fixed~ position. IIRC this would mean that TS2344 would no longer be reported anywhere - and it's the primary reason why I've left it like this. I wasn't sure how I should approach removing an existing error code.

assign<[number, ...number[]], [number, number, number, string]>(); // Error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2344: Type '[number, number, number, string]' does not satisfy the constraint '[number, ...number[]]'.
!!! error TS2344: Type at positions 1 through 3 in source is not compatible with type at position 1 in target.
!!! error TS2344: Type 'string | number' is not assignable to type 'number'.
!!! error TS2344: Type 'string' is not assignable to type 'number'.
!!! error TS2344: Type 'string' is not assignable to type 'number'.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, given what we've had before, I think this is good. It actually might be more clear than the previous message, because before we had type 'string | number' mentioned, but the original code doesn't really have that union type, so that could be confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I also found the union type being reported here kinda unintuitive.

@sandersn
Copy link
Member

@ahejlsberg I believe you were the last one to work on the tuple length assignability rules. Can you take a look at this too?

@gabritto
Copy link
Member

@typescript-bot test this
@typescript-bot user test this
@typescript-bot perf test this
@typescript-bot test top100

@typescript-bot
Copy link
Collaborator

typescript-bot commented Oct 27, 2022

Heya @gabritto, I've started to run the perf test suite on this PR at ab0eb5c. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Oct 27, 2022

Heya @gabritto, I've started to run the diff-based user code test suite on this PR at ab0eb5c. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

typescript-bot commented Oct 27, 2022

Heya @gabritto, I've started to run the extended test suite on this PR at ab0eb5c. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Oct 27, 2022

Heya @gabritto, I've started to run the diff-based top-repos suite on this PR at ab0eb5c. You can monitor the build here.

Update: The results are in!

@typescript-bot
Copy link
Collaborator

@gabritto Here are the results of running the user test suite comparing main and refs/pull/50218/merge:

Everything looks good!

@typescript-bot
Copy link
Collaborator

Heya @gabritto, I've run the RWC suite on this PR - assuming you're on the TS core team, you can view the resulting diff here.

@typescript-bot
Copy link
Collaborator

@gabritto
The results of the perf run you requested are in!

Here they are:

Compiler

Comparison Report - main..50218
Metric main 50218 Delta Best Worst
Angular - node (v18.10.0, x64)
Memory used 353,959k (± 0.03%) 353,889k (± 0.02%) -70k (- 0.02%) 353,666k 354,007k
Parse Time 1.57s (± 0.83%) 1.56s (± 0.55%) -0.00s (- 0.19%) 1.55s 1.58s
Bind Time 0.61s (± 0.73%) 0.60s (± 0.56%) -0.01s (- 0.82%) 0.60s 0.61s
Check Time 4.42s (± 0.47%) 4.41s (± 0.32%) -0.01s (- 0.32%) 4.38s 4.45s
Emit Time 4.92s (± 0.37%) 4.93s (± 0.51%) +0.00s (+ 0.08%) 4.87s 4.97s
Total Time 11.51s (± 0.20%) 11.50s (± 0.27%) -0.01s (- 0.09%) 11.42s 11.56s
Compiler-Unions - node (v18.10.0, x64)
Memory used 200,232k (± 0.84%) 200,238k (± 0.84%) +5k (+ 0.00%) 195,685k 201,517k
Parse Time 0.60s (± 0.74%) 0.60s (± 1.13%) +0.00s (+ 0.33%) 0.59s 0.62s
Bind Time 0.36s (± 0.92%) 0.36s (± 0.82%) +0.00s (+ 0.56%) 0.36s 0.37s
Check Time 5.37s (± 0.36%) 5.36s (± 0.69%) -0.01s (- 0.11%) 5.30s 5.46s
Emit Time 1.81s (± 0.74%) 1.81s (± 1.60%) -0.01s (- 0.55%) 1.74s 1.89s
Total Time 8.14s (± 0.32%) 8.14s (± 0.65%) -0.01s (- 0.09%) 8.03s 8.26s
Monaco - node (v18.10.0, x64)
Memory used 331,782k (± 0.02%) 331,773k (± 0.01%) -9k (- 0.00%) 331,672k 331,881k
Parse Time 1.17s (± 0.79%) 1.18s (± 1.01%) +0.02s (+ 1.28%) 1.16s 1.21s
Bind Time 0.56s (± 0.89%) 0.56s (± 1.00%) +0.00s (+ 0.36%) 0.55s 0.57s
Check Time 4.32s (± 0.94%) 4.31s (± 0.83%) -0.01s (- 0.28%) 4.23s 4.38s
Emit Time 2.64s (± 0.76%) 2.63s (± 0.40%) -0.01s (- 0.34%) 2.61s 2.65s
Total Time 8.68s (± 0.74%) 8.68s (± 0.54%) -0.00s (- 0.06%) 8.60s 8.80s
TFS - node (v18.10.0, x64)
Memory used 294,746k (± 0.01%) 294,712k (± 0.01%) -34k (- 0.01%) 294,606k 294,782k
Parse Time 0.93s (± 0.81%) 0.94s (± 1.25%) +0.01s (+ 0.75%) 0.92s 0.98s
Bind Time 0.59s (± 3.46%) 0.59s (± 4.82%) +0.00s (+ 0.00%) 0.55s 0.66s
Check Time 4.02s (± 0.55%) 4.01s (± 0.55%) -0.01s (- 0.27%) 3.97s 4.06s
Emit Time 2.63s (± 0.67%) 2.65s (± 0.83%) +0.02s (+ 0.61%) 2.60s 2.69s
Total Time 8.17s (± 0.45%) 8.19s (± 0.75%) +0.02s (+ 0.20%) 8.06s 8.33s
material-ui - node (v18.10.0, x64)
Memory used 439,993k (± 0.01%) 439,960k (± 0.02%) -32k (- 0.01%) 439,781k 440,129k
Parse Time 1.36s (± 0.52%) 1.35s (± 0.66%) -0.00s (- 0.29%) 1.34s 1.38s
Bind Time 0.45s (± 1.28%) 0.45s (± 1.30%) -0.00s (- 0.67%) 0.43s 0.46s
Check Time 10.88s (± 0.97%) 10.89s (± 0.59%) +0.01s (+ 0.08%) 10.73s 11.05s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 12.69s (± 0.85%) 12.69s (± 0.51%) +0.00s (+ 0.02%) 12.54s 12.86s
xstate - node (v18.10.0, x64)
Memory used 557,297k (± 0.01%) 557,350k (± 0.02%) +53k (+ 0.01%) 557,181k 557,747k
Parse Time 1.91s (± 0.40%) 1.92s (± 0.48%) +0.01s (+ 0.42%) 1.91s 1.95s
Bind Time 0.69s (± 1.96%) 0.70s (± 2.71%) +0.01s (+ 1.45%) 0.66s 0.75s
Check Time 1.10s (± 0.77%) 1.10s (± 0.54%) +0.00s (+ 0.36%) 1.10s 1.12s
Emit Time 0.06s (± 0.00%) 0.06s (± 0.00%) 0.00s ( 0.00%) 0.06s 0.06s
Total Time 3.76s (± 0.67%) 3.78s (± 0.38%) +0.02s (+ 0.59%) 3.76s 3.82s
Angular - node (v16.17.1, x64)
Memory used 353,435k (± 0.01%) 353,415k (± 0.02%) -20k (- 0.01%) 353,211k 353,516k
Parse Time 1.90s (± 0.80%) 1.90s (± 0.40%) +0.00s (+ 0.21%) 1.89s 1.92s
Bind Time 0.75s (± 0.59%) 0.75s (± 0.82%) -0.00s (- 0.40%) 0.74s 0.76s
Check Time 5.71s (± 0.59%) 5.68s (± 0.57%) -0.03s (- 0.56%) 5.64s 5.77s
Emit Time 6.10s (± 0.92%) 6.08s (± 0.50%) -0.03s (- 0.43%) 6.02s 6.16s
Total Time 14.46s (± 0.58%) 14.40s (± 0.41%) -0.06s (- 0.40%) 14.33s 14.60s
Compiler-Unions - node (v16.17.1, x64)
Memory used 198,089k (± 0.49%) 198,069k (± 0.50%) -20k (- 0.01%) 197,340k 200,819k
Parse Time 0.78s (± 0.63%) 0.79s (± 1.05%) +0.00s (+ 0.26%) 0.77s 0.81s
Bind Time 0.46s (± 0.97%) 0.45s (± 0.75%) -0.00s (- 1.09%) 0.45s 0.46s
Check Time 6.42s (± 0.42%) 6.43s (± 0.43%) +0.01s (+ 0.16%) 6.36s 6.49s
Emit Time 2.26s (± 0.92%) 2.27s (± 0.93%) +0.00s (+ 0.22%) 2.23s 2.31s
Total Time 9.92s (± 0.33%) 9.94s (± 0.48%) +0.02s (+ 0.16%) 9.83s 10.06s
Monaco - node (v16.17.1, x64)
Memory used 331,194k (± 0.01%) 331,190k (± 0.01%) -4k (- 0.00%) 331,098k 331,241k
Parse Time 1.43s (± 0.40%) 1.44s (± 1.04%) +0.01s (+ 0.42%) 1.41s 1.48s
Bind Time 0.69s (± 0.65%) 0.69s (± 0.58%) +0.00s (+ 0.44%) 0.68s 0.70s
Check Time 5.49s (± 0.71%) 5.48s (± 0.58%) -0.01s (- 0.22%) 5.40s 5.55s
Emit Time 3.26s (± 0.55%) 3.25s (± 0.65%) -0.01s (- 0.37%) 3.21s 3.31s
Total Time 10.87s (± 0.49%) 10.86s (± 0.38%) -0.01s (- 0.12%) 10.75s 10.94s
TFS - node (v16.17.1, x64)
Memory used 294,081k (± 0.01%) 294,071k (± 0.02%) -10k (- 0.00%) 293,889k 294,170k
Parse Time 1.23s (± 1.20%) 1.23s (± 1.19%) -0.00s (- 0.24%) 1.18s 1.26s
Bind Time 0.64s (± 0.47%) 0.64s (± 0.35%) +0.00s (+ 0.16%) 0.63s 0.64s
Check Time 5.12s (± 0.31%) 5.11s (± 0.57%) -0.00s (- 0.08%) 5.06s 5.17s
Emit Time 3.49s (± 0.67%) 3.49s (± 0.71%) +0.00s (+ 0.09%) 3.44s 3.55s
Total Time 10.47s (± 0.35%) 10.47s (± 0.48%) -0.01s (- 0.05%) 10.38s 10.60s
material-ui - node (v16.17.1, x64)
Memory used 439,299k (± 0.01%) 439,315k (± 0.01%) +17k (+ 0.00%) 439,261k 439,413k
Parse Time 1.72s (± 0.78%) 1.74s (± 1.47%) +0.02s (+ 1.22%) 1.68s 1.77s
Bind Time 0.54s (± 0.87%) 0.54s (± 0.74%) -0.00s (- 0.19%) 0.53s 0.55s
Check Time 12.54s (± 0.56%) 12.50s (± 0.68%) -0.04s (- 0.31%) 12.30s 12.63s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 14.80s (± 0.52%) 14.79s (± 0.70%) -0.01s (- 0.09%) 14.51s 14.92s
xstate - node (v16.17.1, x64)
Memory used 554,970k (± 0.00%) 555,015k (± 0.01%) +45k (+ 0.01%) 554,900k 555,244k
Parse Time 2.31s (± 0.39%) 2.32s (± 0.22%) +0.01s (+ 0.43%) 2.31s 2.33s
Bind Time 0.89s (± 1.60%) 0.90s (± 2.06%) +0.01s (+ 1.24%) 0.87s 0.94s
Check Time 1.43s (± 0.62%) 1.42s (± 0.70%) -0.01s (- 0.70%) 1.40s 1.44s
Emit Time 0.07s (± 5.08%) 0.07s (± 3.23%) +0.00s (+ 2.99%) 0.06s 0.07s
Total Time 4.69s (± 0.27%) 4.71s (± 0.29%) +0.02s (+ 0.41%) 4.68s 4.73s
Angular - node (v14.15.1, x64)
Memory used 347,637k (± 0.01%) 347,632k (± 0.01%) -6k (- 0.00%) 347,547k 347,735k
Parse Time 2.10s (± 1.32%) 2.09s (± 0.69%) -0.01s (- 0.43%) 2.06s 2.13s
Bind Time 0.80s (± 0.65%) 0.80s (± 0.59%) +0.00s (+ 0.13%) 0.79s 0.81s
Check Time 5.97s (± 0.49%) 5.99s (± 0.24%) +0.02s (+ 0.27%) 5.97s 6.03s
Emit Time 6.29s (± 0.86%) 6.28s (± 0.50%) -0.01s (- 0.16%) 6.20s 6.35s
Total Time 15.16s (± 0.44%) 15.15s (± 0.30%) -0.01s (- 0.06%) 15.05s 15.27s
Compiler-Unions - node (v14.15.1, x64)
Memory used 190,922k (± 0.68%) 191,164k (± 0.71%) +242k (+ 0.13%) 190,260k 196,144k
Parse Time 0.86s (± 0.46%) 0.86s (± 0.84%) +0.00s (+ 0.12%) 0.85s 0.88s
Bind Time 0.49s (± 0.69%) 0.49s (± 0.96%) 0.00s ( 0.00%) 0.49s 0.51s
Check Time 6.74s (± 0.50%) 6.77s (± 0.47%) +0.03s (+ 0.43%) 6.68s 6.82s
Emit Time 2.44s (± 0.81%) 2.43s (± 0.61%) -0.00s (- 0.12%) 2.40s 2.47s
Total Time 10.53s (± 0.31%) 10.55s (± 0.40%) +0.03s (+ 0.24%) 10.43s 10.63s
Monaco - node (v14.15.1, x64)
Memory used 326,551k (± 0.01%) 326,543k (± 0.01%) -7k (- 0.00%) 326,496k 326,596k
Parse Time 1.58s (± 0.59%) 1.58s (± 0.38%) +0.00s (+ 0.13%) 1.57s 1.60s
Bind Time 0.73s (± 0.71%) 0.73s (± 0.46%) +0.00s (+ 0.27%) 0.73s 0.74s
Check Time 5.77s (± 0.50%) 5.75s (± 0.38%) -0.02s (- 0.38%) 5.69s 5.80s
Emit Time 3.41s (± 1.12%) 3.38s (± 0.69%) -0.03s (- 1.00%) 3.34s 3.44s
Total Time 11.50s (± 0.42%) 11.45s (± 0.20%) -0.05s (- 0.44%) 11.41s 11.51s
TFS - node (v14.15.1, x64)
Memory used 289,705k (± 0.01%) 289,726k (± 0.01%) +21k (+ 0.01%) 289,665k 289,775k
Parse Time 1.29s (± 0.62%) 1.31s (± 0.94%) +0.02s (+ 1.24%) 1.29s 1.34s
Bind Time 0.80s (± 0.62%) 0.80s (± 1.58%) -0.01s (- 0.75%) 0.75s 0.81s
Check Time 5.42s (± 0.60%) 5.42s (± 0.38%) +0.01s (+ 0.11%) 5.37s 5.46s
Emit Time 3.64s (± 0.66%) 3.63s (± 0.44%) -0.01s (- 0.25%) 3.59s 3.67s
Total Time 11.16s (± 0.43%) 11.16s (± 0.28%) +0.00s (+ 0.02%) 11.09s 11.24s
material-ui - node (v14.15.1, x64)
Memory used 435,455k (± 0.01%) 435,424k (± 0.00%) -32k (- 0.01%) 435,375k 435,470k
Parse Time 1.89s (± 0.56%) 1.90s (± 0.39%) +0.01s (+ 0.53%) 1.89s 1.92s
Bind Time 0.58s (± 0.38%) 0.59s (± 1.14%) +0.01s (+ 1.38%) 0.58s 0.61s
Check Time 12.81s (± 0.39%) 12.85s (± 0.38%) +0.04s (+ 0.30%) 12.74s 12.93s
Emit Time 0.00s (± 0.00%) 0.00s (± 0.00%) 0.00s ( NaN%) 0.00s 0.00s
Total Time 15.28s (± 0.32%) 15.33s (± 0.34%) +0.05s (+ 0.36%) 15.23s 15.43s
xstate - node (v14.15.1, x64)
Memory used 544,078k (± 0.00%) 544,063k (± 0.00%) -15k (- 0.00%) 544,017k 544,118k
Parse Time 2.62s (± 0.54%) 2.61s (± 0.31%) -0.01s (- 0.34%) 2.59s 2.63s
Bind Time 0.98s (± 0.94%) 0.99s (± 1.02%) +0.00s (+ 0.41%) 0.97s 1.01s
Check Time 1.52s (± 0.54%) 1.52s (± 0.67%) -0.00s (- 0.26%) 1.50s 1.55s
Emit Time 0.07s (± 0.00%) 0.07s (± 3.14%) +0.00s (+ 1.43%) 0.07s 0.08s
Total Time 5.20s (± 0.33%) 5.19s (± 0.21%) -0.01s (- 0.15%) 5.16s 5.21s
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-126-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.15.1, x64)
Scenarios
  • Angular - node (v18.10.0, x64)
  • Angular - node (v16.17.1, x64)
  • Angular - node (v14.15.1, x64)
  • Compiler-Unions - node (v18.10.0, x64)
  • Compiler-Unions - node (v16.17.1, x64)
  • Compiler-Unions - node (v14.15.1, x64)
  • Monaco - node (v18.10.0, x64)
  • Monaco - node (v16.17.1, x64)
  • Monaco - node (v14.15.1, x64)
  • TFS - node (v18.10.0, x64)
  • TFS - node (v16.17.1, x64)
  • TFS - node (v14.15.1, x64)
  • material-ui - node (v18.10.0, x64)
  • material-ui - node (v16.17.1, x64)
  • material-ui - node (v14.15.1, x64)
  • xstate - node (v18.10.0, x64)
  • xstate - node (v16.17.1, x64)
  • xstate - node (v14.15.1, x64)
Benchmark Name Iterations
Current 50218 10
Baseline main 10

TSServer

Comparison Report - main..50218
Metric main 50218 Delta Best Worst
Compiler-UnionsTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 1,061ms (± 0.31%) 1,070ms (± 0.66%) +9ms (+ 0.86%) 1,060ms 1,093ms
Req 2 - geterr 2,716ms (± 0.58%) 2,712ms (± 0.65%) -3ms (- 0.12%) 2,672ms 2,761ms
Req 3 - references 192ms (± 1.21%) 193ms (± 1.05%) +2ms (+ 0.83%) 190ms 200ms
Req 4 - navto 147ms (± 0.97%) 148ms (± 1.12%) +1ms (+ 0.88%) 145ms 152ms
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) 0 ( 0.00%) 1,356 1,356
Req 5 - completionInfo 44ms (± 0.51%) 44ms (± 1.99%) +0ms (+ 0.91%) 43ms 47ms
CompilerTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 1,132ms (± 0.67%) 1,139ms (± 0.91%) +7ms (+ 0.63%) 1,120ms 1,160ms
Req 2 - geterr 1,600ms (± 0.42%) 1,606ms (± 0.54%) +7ms (+ 0.41%) 1,590ms 1,624ms
Req 3 - references 197ms (± 0.75%) 197ms (± 0.61%) -0ms (- 0.05%) 195ms 199ms
Req 4 - navto 160ms (± 1.82%) 162ms (± 1.50%) +2ms (+ 1.12%) 157ms 168ms
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) 0 ( 0.00%) 1,518 1,518
Req 5 - completionInfo 83ms (± 4.05%) 80ms (± 3.32%) 🟩-4ms (- 4.45%) 75ms 87ms
xstateTSServer - node (v18.10.0, x64)
Req 1 - updateOpen 1,626ms (± 0.56%) 1,624ms (± 0.61%) -2ms (- 0.10%) 1,604ms 1,646ms
Req 2 - geterr 577ms (± 0.94%) 574ms (± 0.63%) -3ms (- 0.54%) 565ms 581ms
Req 3 - references 52ms (± 0.97%) 52ms (± 1.39%) +1ms (+ 1.36%) 51ms 54ms
Req 4 - navto 207ms (± 0.77%) 205ms (± 0.87%) -1ms (- 0.68%) 202ms 210ms
Req 5 - completionInfo count 3,209 (± 0.00%) 3,209 (± 0.00%) 0 ( 0.00%) 3,209 3,209
Req 5 - completionInfo 210ms (± 2.20%) 209ms (± 2.09%) -1ms (- 0.62%) 202ms 219ms
Compiler-UnionsTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 1,337ms (± 0.65%) 1,329ms (± 0.33%) -8ms (- 0.62%) 1,320ms 1,337ms
Req 2 - geterr 3,281ms (± 0.42%) 3,285ms (± 0.68%) +5ms (+ 0.15%) 3,251ms 3,339ms
Req 3 - references 221ms (± 0.79%) 223ms (± 1.39%) +2ms (+ 0.81%) 218ms 231ms
Req 4 - navto 158ms (± 0.60%) 158ms (± 0.57%) -0ms (- 0.19%) 156ms 160ms
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) 0 ( 0.00%) 1,356 1,356
Req 5 - completionInfo 60ms (±18.01%) 64ms (±19.04%) +4ms (+ 6.14%) 52ms 91ms
CompilerTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 1,404ms (± 0.49%) 1,408ms (± 0.56%) +4ms (+ 0.31%) 1,393ms 1,431ms
Req 2 - geterr 2,109ms (± 0.51%) 2,108ms (± 0.30%) -1ms (- 0.06%) 2,097ms 2,123ms
Req 3 - references 231ms (± 0.80%) 231ms (± 0.78%) 0ms ( 0.00%) 227ms 237ms
Req 4 - navto 174ms (± 6.08%) 170ms (± 0.81%) -4ms (- 2.30%) 167ms 174ms
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) 0 ( 0.00%) 1,518 1,518
Req 5 - completionInfo 53ms (± 0.95%) 55ms (± 7.04%) +2ms (+ 4.57%) 50ms 63ms
xstateTSServer - node (v16.17.1, x64)
Req 1 - updateOpen 1,935ms (± 0.52%) 1,932ms (± 0.59%) -3ms (- 0.18%) 1,909ms 1,960ms
Req 2 - geterr 730ms (± 0.61%) 729ms (± 0.85%) -0ms (- 0.04%) 720ms 748ms
Req 3 - references 61ms (± 1.44%) 60ms (± 0.92%) -1ms (- 1.79%) 59ms 62ms
Req 4 - navto 208ms (± 0.89%) 208ms (± 0.88%) +0ms (+ 0.10%) 204ms 211ms
Req 5 - completionInfo count 3,209 (± 0.00%) 3,209 (± 0.00%) 0 ( 0.00%) 3,209 3,209
Req 5 - completionInfo 258ms (± 0.94%) 257ms (± 0.61%) -1ms (- 0.31%) 252ms 260ms
Compiler-UnionsTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 1,452ms (± 0.65%) 1,457ms (± 0.63%) +5ms (+ 0.36%) 1,444ms 1,489ms
Req 2 - geterr 3,529ms (± 0.44%) 3,539ms (± 0.58%) +10ms (+ 0.29%) 3,499ms 3,586ms
Req 3 - references 233ms (± 0.58%) 233ms (± 0.75%) +1ms (+ 0.26%) 230ms 238ms
Req 4 - navto 173ms (± 0.75%) 173ms (± 0.62%) +0ms (+ 0.17%) 170ms 175ms
Req 5 - completionInfo count 1,356 (± 0.00%) 1,356 (± 0.00%) 0 ( 0.00%) 1,356 1,356
Req 5 - completionInfo 55ms (± 0.87%) 56ms (± 1.37%) +1ms (+ 1.46%) 54ms 58ms
CompilerTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 1,532ms (± 0.62%) 1,534ms (± 0.57%) +2ms (+ 0.14%) 1,518ms 1,555ms
Req 2 - geterr 2,319ms (± 0.33%) 2,316ms (± 0.74%) -3ms (- 0.12%) 2,292ms 2,380ms
Req 3 - references 245ms (± 0.40%) 246ms (± 0.49%) +1ms (+ 0.37%) 244ms 249ms
Req 4 - navto 183ms (± 0.64%) 184ms (± 0.57%) +1ms (+ 0.49%) 182ms 187ms
Req 5 - completionInfo count 1,518 (± 0.00%) 1,518 (± 0.00%) 0 ( 0.00%) 1,518 1,518
Req 5 - completionInfo 55ms (± 0.95%) 55ms (± 1.41%) 0ms ( 0.00%) 53ms 57ms
xstateTSServer - node (v14.15.1, x64)
Req 1 - updateOpen 2,160ms (± 0.60%) 2,164ms (± 0.47%) +4ms (+ 0.17%) 2,130ms 2,182ms
Req 2 - geterr 760ms (± 0.51%) 763ms (± 0.45%) +4ms (+ 0.46%) 753ms 767ms
Req 3 - references 66ms (± 1.91%) 66ms (± 2.07%) +0ms (+ 0.30%) 64ms 70ms
Req 4 - navto 229ms (± 0.58%) 229ms (± 0.77%) +0ms (+ 0.13%) 227ms 234ms
Req 5 - completionInfo count 3,209 (± 0.00%) 3,209 (± 0.00%) 0 ( 0.00%) 3,209 3,209
Req 5 - completionInfo 281ms (± 0.53%) 283ms (± 3.88%) +3ms (+ 0.89%) 268ms 326ms
System
Machine Namets-ci-ubuntu
Platformlinux 5.4.0-126-generic
Architecturex64
Available Memory16 GB
Available Memory15 GB
CPUs4 × Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
Hosts
  • node (v18.10.0, x64)
  • node (v16.17.1, x64)
  • node (v14.15.1, x64)
Scenarios
  • Compiler-UnionsTSServer - node (v18.10.0, x64)
  • Compiler-UnionsTSServer - node (v16.17.1, x64)
  • Compiler-UnionsTSServer - node (v14.15.1, x64)
  • CompilerTSServer - node (v18.10.0, x64)
  • CompilerTSServer - node (v16.17.1, x64)
  • CompilerTSServer - node (v14.15.1, x64)
  • xstateTSServer - node (v18.10.0, x64)
  • xstateTSServer - node (v16.17.1, x64)
  • xstateTSServer - node (v14.15.1, x64)
Benchmark Name Iterations
Current 50218 10
Baseline main 10

Developer Information:

Download Benchmark

@gabritto
Copy link
Member

@typescript-bot run dt

@typescript-bot
Copy link
Collaborator

typescript-bot commented Oct 27, 2022

Heya @gabritto, I've started to run the parallelized Definitely Typed test suite on this PR at ab0eb5c. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

@gabritto Here are the results of running the top-repos suite comparing main and refs/pull/50218/merge:

Everything looks good!

@gabritto
Copy link
Member

Ok, all the tests look clean, so I think we're good to merge this once we snap for 5.0. Thanks!

@gabritto gabritto merged commit 46b015f into microsoft:main Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Variadic tuple with any[] spread incorrectly assignable to shorter variadic tuple target
4 participants