Uh oh!
There was an error while loading. Please reload this page.
Derive tuple labels for rest elements from array binding patterns - #59045
Conversation
TypeScript Bot (@typescript-bot) test it |
TypeScript Bot (typescript-bot)
commented
Jun 27, 2024
Hey Daniel Rosenwasser (@DanielRosenwasser), the results of running the DT tests are ready. Everything looks the same! |
TypeScript Bot (typescript-bot)
commented
Jun 27, 2024
Daniel Rosenwasser (@DanielRosenwasser) Here are the results of running the user tests with tsc comparing Everything looks good! |
TypeScript Bot (typescript-bot)
commented
Jun 27, 2024
Daniel Rosenwasser (@DanielRosenwasser) Here they are:tscComparison Report - baseline..pr
System info unknown Hosts
Scenarios
Developer Information: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
TypeScript Bot (typescript-bot)
commented
Jun 27, 2024
Daniel Rosenwasser (@DanielRosenwasser) Here are the results of running the top 400 repos with tsc comparing Everything looks good! |
Mateusz Burzyński (Andarist)
commented
Jun 27, 2024
I already have a very related change to this open here. Both PRs touch the same area of the code and solve very overlapping problems, I think it would make sense to merge both |
Jake Bailey (jakebailey)
commented
Jul 16, 2024
Seems fine to me, but does need a sync from main and baseline update. |
a497918 to
ae645c3Compare
While working on #58243, a community member asked if we could label the tuple we use to properly type arguments to the
next()methods of iterators and generators. A brief experiment showed that directly labeling the tuple element resulted in the creation of thousands of new types in some tests since iterator/generator instantiations would produce new named tuple elements since named tuple elements are cached far less frequently.An alternative to that approach would be to use an additional source for the label when the label comes from a rest parameter whose name is actually an
ArrayBindingPattern:Since this is merely treated as an additional labeling source, there is no need to synthesize additional types for named tuple elements.
This also improves label inference in other cases such as elision and object assignment pattern elements:
Related #58243 (comment)
Fixes#56289
Closes#57619