Repository navigation
Defer conditional types with multi-element tuple types in extends clause - #52091
Conversation
|
TypeScript Bot (@typescript-bot) test this |
|
Heya Anders Hejlsberg (@ahejlsberg), I've started to run the extended test suite on this PR at e9f81ce. You can monitor the build here. |
|
Heya Anders Hejlsberg (@ahejlsberg), I've started to run the diff-based user code test suite on this PR at e9f81ce. You can monitor the build here. Update: The results are in! |
|
Heya Anders Hejlsberg (@ahejlsberg), I've started to run the abridged perf test suite on this PR at e9f81ce. You can monitor the build here. Update: The results are in! |
|
Heya Anders Hejlsberg (@ahejlsberg), I've started to run the diff-based top-repos suite on this PR at e9f81ce. You can monitor the build here. |
|
Heya Anders Hejlsberg (@ahejlsberg), I've started to run the parallelized Definitely Typed test suite on this PR at e9f81ce. You can monitor the build here. |
|
Anders Hejlsberg (@ahejlsberg) Here are the results of running the user test suite comparing Everything looks good! |
|
Heya Anders Hejlsberg (@ahejlsberg), I've run the RWC suite on this PR - assuming you're on the TS core team, you can view the resulting diff here. |
|
Anders Hejlsberg (@ahejlsberg) Here they are:Comparison Report - main..52091
System
Hosts
Scenarios
Developer Information: |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
… types as of TS4.9, conditional types are only deferred for single-element tuples, not multi-element ones. this should be fixed in microsoft/TypeScript#52091, slated for the TS5.0 milestone. until then, however, the implementations of `MutuallyAssignable`, `And`, and `Xor` can be assumed to be bugged. this commit fixes them to properly defer types. `Or` was also like this but fixed in earlier commit 0cd75d4
Wesley Wigham (weswigham)
left a comment
There was a problem hiding this comment.
We don't want to think of a way to expand this to cover, eg {x: X} extends {x: Y} and similar ilk, right?
|
Wesley Wigham (@weswigham) Would be nice to do so, but requires more thinking about permissive/restrictive instantiations and/or some sort of "possibly assignable to" relation. I'm chewing on that, but nothing concrete yet. |
Fixes #52068.