GeezerVison is showing github.com — Avoid incorrectly reusing assertion nodes from property assignments by Andarist · Pull Request #60576 · microsoft/TypeScript
Conversation
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
robpalme reacted with thumbs up emoji
|
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…nodes-with-different-types
|
If this fixes #60573, we should definitely add a dts test that shows that things are fixed.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+713
to
+714
|
|
if (assertionNode && !isConstTypeReference(assertionNode) && resolver.canReuseTypeNodeAnnotation(context, node, assertionNode, symbol)) {
|
|
|
result = serializeExistingTypeNode(assertionNode, context);
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was largely unsure about this given you ask a question about node then use that to work with assertionNode, but this is effectively the same check as:
function typeFromPropertyAssignment(node: PropertyAssignment | ShorthandPropertyAssignment, symbol: Symbol, context: SyntacticTypeNodeBuilderContext) {
const typeAnnotation = getEffectiveTypeAnnotationNode(node);
let result;
if (typeAnnotation && resolver.canReuseTypeNodeAnnotation(context, node, typeAnnotation, symbol)) {
result = serializeExistingTypeNode(typeAnnotation, context);
}
So I definitely like this change more than the initial version.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Andarist reacted with thumbs up emoji
typescript-bot reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Starting jobs; this comment will be updated as builds start and complete.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Jake Bailey (@jakebailey) Here are the results of running the user tests with tsc comparing main and refs/pull/60576/merge:
Everything looks good!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…nodes-with-different-types
|
Jake Bailey (@jakebailey)
The results of the perf run you requested are in!
Here they are:
tsc
Comparison Report - baseline..pr
| Metric |
baseline |
pr |
Delta |
Best |
Worst |
p-value |
| Compiler-Unions - node (v18.15.0, x64) |
| Errors |
34 |
34 |
~ |
~ |
~ |
p=1.000 n=6 |
| Symbols |
62,363 |
62,363 |
~ |
~ |
~ |
p=1.000 n=6 |
| Types |
50,395 |
50,395 |
~ |
~ |
~ |
p=1.000 n=6 |
| Memory used |
194,233k (± 0.95%) |
194,267k (± 0.97%) |
~ |
193,042k |
196,713k |
p=0.748 n=6 |
| Parse Time |
1.30s (± 1.15%) |
1.31s (± 0.68%) |
~ |
1.30s |
1.32s |
p=0.456 n=6 |
| Bind Time |
0.72s |
0.72s |
~ |
~ |
~ |
p=1.000 n=6 |
| Check Time |
9.78s (± 0.36%) |
9.79s (± 0.46%) |
~ |
9.72s |
9.85s |
p=0.872 n=6 |
| Emit Time |
2.73s (± 0.38%) |
2.73s (± 0.65%) |
~ |
2.71s |
2.76s |
p=0.805 n=6 |
| Total Time |
14.53s (± 0.29%) |
14.54s (± 0.41%) |
~ |
14.48s |
14.64s |
p=0.936 n=6 |
| angular-1 - node (v18.15.0, x64) |
| Errors |
37 |
37 |
~ |
~ |
~ |
p=1.000 n=6 |
| Symbols |
947,936 |
947,936 |
~ |
~ |
~ |
p=1.000 n=6 |
| Types |
410,955 |
410,955 |
~ |
~ |
~ |
p=1.000 n=6 |
| Memory used |
1,226,007k (± 0.00%) |
1,226,016k (± 0.00%) |
~ |
1,225,935k |
1,226,080k |
p=0.575 n=6 |
| Parse Time |
6.63s (± 0.55%) |
6.64s (± 0.52%) |
~ |
6.58s |
6.68s |
p=0.871 n=6 |
| Bind Time |
1.89s (± 0.22%) |
1.89s (± 0.58%) |
~ |
1.88s |
1.91s |
p=1.000 n=6 |
| Check Time |
32.00s (± 0.34%) |
31.96s (± 0.33%) |
~ |
31.87s |
32.15s |
p=0.517 n=6 |
| Emit Time |
15.22s (± 0.37%) |
15.18s (± 0.31%) |
~ |
15.10s |
15.22s |
p=0.167 n=6 |
| Total Time |
55.74s (± 0.25%) |
55.66s (± 0.25%) |
~ |
55.48s |
55.86s |
p=0.471 n=6 |
| mui-docs - node (v18.15.0, x64) |
| Errors |
0 |
0 |
~ |
~ |
~ |
p=1.000 n=6 |
| Symbols |
2,501,823 |
2,501,823 |
~ |
~ |
~ |
p=1.000 n=6 |
| Types |
909,645 |
909,645 |
~ |
~ |
~ |
p=1.000 n=6 |
| Memory used |
2,319,287k (± 0.00%) |
2,319,273k (± 0.00%) |
~ |
2,319,207k |
2,319,317k |
p=0.378 n=6 |
| Parse Time |
9.30s (± 0.18%) |
9.30s (± 0.23%) |
~ |
9.28s |
9.33s |
p=0.514 n=6 |
| Bind Time |
2.16s (± 0.83%) |
2.15s (± 0.97%) |
~ |
2.12s |
2.18s |
p=0.452 n=6 |
| Check Time |
74.95s (± 0.23%) |
74.98s (± 0.37%) |
~ |
74.57s |
75.42s |
p=0.936 n=6 |
| Emit Time |
0.28s |
0.28s (± 3.53%) |
~ |
0.27s |
0.29s |
p=0.652 n=6 |
| Total Time |
86.69s (± 0.21%) |
86.72s (± 0.32%) |
~ |
86.31s |
87.17s |
p=0.686 n=6 |
| self-build-src - node (v18.15.0, x64) |
| Errors |
0 |
0 |
~ |
~ |
~ |
p=1.000 n=6 |
| Symbols |
1,225,287 |
1,225,287 |
~ |
~ |
~ |
p=1.000 n=6 |
| Types |
266,555 |
266,555 |
~ |
~ |
~ |
p=1.000 n=6 |
| Memory used |
2,354,218k (± 0.03%) |
2,354,129k (± 0.02%) |
~ |
2,353,675k |
2,354,651k |
p=0.810 n=6 |
| Parse Time |
5.23s (± 0.59%) |
5.25s (± 0.44%) |
~ |
5.23s |
5.29s |
p=0.683 n=6 |
| Bind Time |
1.77s (± 1.57%) |
1.78s (± 1.56%) |
~ |
1.76s |
1.83s |
p=0.746 n=6 |
| Check Time |
35.19s (± 0.65%) |
35.19s (± 0.44%) |
~ |
35.07s |
35.49s |
p=0.873 n=6 |
| Emit Time |
2.97s (± 1.21%) |
3.02s (± 3.00%) |
~ |
2.95s |
3.19s |
p=0.630 n=6 |
| Total Time |
45.17s (± 0.53%) |
45.25s (± 0.55%) |
~ |
45.10s |
45.74s |
p=0.298 n=6 |
| self-build-src-public-api - node (v18.15.0, x64) |
| Errors |
0 |
0 |
~ |
~ |
~ |
p=1.000 n=6 |
| Symbols |
1,225,287 |
1,225,287 |
~ |
~ |
~ |
p=1.000 n=6 |
| Types |
266,555 |
266,555 |
~ |
~ |
~ |
p=1.000 n=6 |
| Memory used |
2,907,885k (±12.87%) |
2,786,589k (±14.24%) |
~ |
2,423,271k |
3,150,329k |
p=0.298 n=6 |
| Parse Time |
6.97s (± 1.41%) |
6.91s (± 2.01%) |
~ |
6.77s |
7.08s |
p=0.575 n=6 |
| Bind Time |
2.16s (± 1.67%) |
2.16s (± 1.82%) |
~ |
2.10s |
2.20s |
p=1.000 n=6 |
| Check Time |
42.73s (± 0.76%) |
42.80s (± 0.52%) |
~ |
42.60s |
43.21s |
p=1.000 n=6 |
| Emit Time |
3.48s (± 2.40%) |
3.57s (± 5.02%) |
~ |
3.40s |
3.83s |
p=0.575 n=6 |
| Total Time |
55.37s (± 0.76%) |
55.43s (± 0.53%) |
~ |
55.01s |
55.91s |
p=0.810 n=6 |
| self-compiler - node (v18.15.0, x64) |
| Errors |
0 |
0 |
~ |
~ |
~ |
p=1.000 n=6 |
| Symbols |
262,259 |
262,259 |
~ |
~ |
~ |
p=1.000 n=6 |
| Types |
106,616 |
106,616 |
~ |
~ |
~ |
p=1.000 n=6 |
| Memory used |
439,871k (± 0.01%) |
439,875k (± 0.01%) |
~ |
439,813k |
439,921k |
p=0.748 n=6 |
| Parse Time |
3.54s (± 0.52%) |
3.52s (± 0.69%) |
~ |
3.50s |
3.56s |
p=0.164 n=6 |
| Bind Time |
1.31s (± 0.89%) |
1.31s (± 0.89%) |
~ |
1.30s |
1.33s |
p=1.000 n=6 |
| Check Time |
18.96s (± 0.50%) |
18.87s (± 0.36%) |
~ |
18.79s |
18.98s |
p=0.093 n=6 |
| Emit Time |
1.52s (± 1.56%) |
1.54s (± 0.89%) |
~ |
1.52s |
1.56s |
p=0.191 n=6 |
| Total Time |
25.33s (± 0.45%) |
25.24s (± 0.25%) |
~ |
25.16s |
25.34s |
p=0.173 n=6 |
| ts-pre-modules - node (v18.15.0, x64) |
| Errors |
70 |
70 |
~ |
~ |
~ |
p=1.000 n=6 |
| Symbols |
226,062 |
226,062 |
~ |
~ |
~ |
p=1.000 n=6 |
| Types |
94,488 |
94,488 |
~ |
~ |
~ |
p=1.000 n=6 |
| Memory used |
371,772k (± 0.07%) |
371,606k (± 0.05%) |
~ |
371,472k |
371,958k |
p=0.173 n=6 |
| Parse Time |
2.92s (± 1.14%) |
2.88s (± 1.45%) |
~ |
2.82s |
2.94s |
p=0.199 n=6 |
| Bind Time |
1.58s (± 0.74%) |
1.59s (± 1.01%) |
~ |
1.57s |
1.61s |
p=0.285 n=6 |
| Check Time |
16.53s (± 0.41%) |
16.48s (± 0.16%) |
~ |
16.44s |
16.50s |
p=0.327 n=6 |
| Emit Time |
0.00s (±244.70%) |
0.00s |
~ |
~ |
~ |
p=0.405 n=6 |
| Total Time |
21.03s (± 0.32%) |
20.96s (± 0.28%) |
~ |
20.89s |
21.04s |
p=0.108 n=6 |
| vscode - node (v18.15.0, x64) |
| Errors |
3 |
3 |
~ |
~ |
~ |
p=1.000 n=6 |
| Symbols |
3,197,663 |
3,197,663 |
~ |
~ |
~ |
p=1.000 n=6 |
| Types |
1,099,162 |
1,099,162 |
~ |
~ |
~ |
p=1.000 n=6 |
| Memory used |
3,271,365k (± 0.01%) |
3,271,502k (± 0.01%) |
~ |
3,271,145k |
3,272,144k |
p=0.173 n=6 |
| Parse Time |
14.08s (± 0.49%) |
14.11s (± 0.53%) |
~ |
14.02s |
14.23s |
p=0.688 n=6 |
| Bind Time |
4.54s (± 0.37%) |
4.52s (± 0.28%) |
-0.02s (- 0.44%) |
4.51s |
4.54s |
p=0.048 n=6 |
| Check Time |
88.17s (± 1.86%) |
87.70s (± 1.90%) |
~ |
86.28s |
90.15s |
p=0.689 n=6 |
| Emit Time |
28.27s (± 2.92%) |
27.60s (± 8.67%) |
~ |
22.81s |
29.12s |
p=1.000 n=6 |
| Total Time |
135.07s (± 0.95%) |
133.93s (± 1.01%) |
~ |
131.70s |
135.77s |
p=0.173 n=6 |
| webpack - node (v18.15.0, x64) |
| Errors |
0 |
0 |
~ |
~ |
~ |
p=1.000 n=6 |
| Symbols |
288,751 |
288,751 |
~ |
~ |
~ |
p=1.000 n=6 |
| Types |
117,157 |
117,157 |
~ |
~ |
~ |
p=1.000 n=6 |
| Memory used |
441,035k (± 0.03%) |
441,029k (± 0.03%) |
~ |
440,839k |
441,224k |
p=1.000 n=6 |
| Parse Time |
4.06s (± 0.83%) |
4.08s (± 0.78%) |
~ |
4.03s |
4.12s |
p=0.376 n=6 |
| Bind Time |
1.76s (± 2.28%) |
1.77s (± 1.82%) |
~ |
1.74s |
1.82s |
p=0.687 n=6 |
| Check Time |
18.90s (± 0.75%) |
18.92s (± 0.55%) |
~ |
18.72s |
19.00s |
p=1.000 n=6 |
| Emit Time |
0.00s |
0.00s |
~ |
~ |
~ |
p=1.000 n=6 |
| Total Time |
24.72s (± 0.64%) |
24.77s (± 0.48%) |
~ |
24.57s |
24.91s |
p=0.810 n=6 |
| xstate-main - node (v18.15.0, x64) |
| Errors |
5 |
5 |
~ |
~ |
~ |
p=1.000 n=6 |
| Symbols |
552,390 |
552,390 |
~ |
~ |
~ |
p=1.000 n=6 |
| Types |
185,096 |
185,096 |
~ |
~ |
~ |
p=1.000 n=6 |
| Memory used |
492,463k (± 0.02%) |
492,518k (± 0.01%) |
~ |
492,450k |
492,614k |
p=0.936 n=6 |
| Parse Time |
3.41s (± 1.01%) |
3.41s (± 0.86%) |
~ |
3.36s |
3.45s |
p=0.935 n=6 |
| Bind Time |
1.18s (± 0.69%) |
1.17s (± 1.03%) |
~ |
1.15s |
1.18s |
p=1.000 n=6 |
| Check Time |
19.55s (± 1.11%) |
19.66s (± 2.43%) |
~ |
19.34s |
20.62s |
p=0.810 n=6 |
| Emit Time |
0.00s |
0.00s |
~ |
~ |
~ |
p=1.000 n=6 |
| Total Time |
24.14s (± 0.88%) |
24.25s (± 2.00%) |
~ |
23.95s |
25.22s |
p=1.000 n=6 |
System info unknown
Scenarios
- Compiler-Unions - node (v18.15.0, x64)
- angular-1 - node (v18.15.0, x64)
- mui-docs - node (v18.15.0, x64)
- self-build-src - node (v18.15.0, x64)
- self-build-src-public-api - node (v18.15.0, x64)
- self-compiler - node (v18.15.0, x64)
- ts-pre-modules - node (v18.15.0, x64)
- vscode - node (v18.15.0, x64)
- webpack - node (v18.15.0, x64)
- xstate-main - node (v18.15.0, x64)
| Benchmark |
Name |
Iterations |
| Current |
pr |
6 |
| Baseline |
baseline |
6 |
Developer Information:Download Benchmarks
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
typescript-bot reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Starting jobs; this comment will be updated as builds start and complete.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+31
to
+34
|
|
//// [declarationAssertionNodeNotReusedWhenTypeNotEquivalent1.d.ts]
|
|
|
export declare const unwrapped: {
|
|
|
prop1: "hello";
|
|
|
};
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this looks solid now. It'd probably be relevant to ask what output this limits under isolatedDeclarations, but... 🤷♂️ it kinda is what it is.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Jake Bailey (@jakebailey) Here are the results of running the top 400 repos with tsc comparing main and refs/pull/60576/merge:
Everything looks good!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
typescript-bot reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Starting jobs; this comment will be updated as builds start and complete.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
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/164278/artifacts?artifactName=tgz&fileId=579FD5D10F806287DEC373A9533F60476A5F5163C508B9047F1A00060D2FA2A002&fileName=/typescript-5.8.0-insiders.20241204.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/[email protected]".;
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Jake Bailey (@jakebailey) Here are the results of running the user tests with tsc comparing main and refs/pull/60576/merge:
Everything looks good!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
typescript-bot reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Starting jobs; this comment will be updated as builds start and complete.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
+1 more reviewer
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|