| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
TypeScript Bot (@typescript-bot) user test this inline |
Sorry, something went wrong.
|
Heya Andrew Branch (@andrewbranch), I've started to run the inline community code test suite on this PR at c3bcc4c. You can monitor the build here. Update: The results are in! |
Sorry, something went wrong.
|
Andrew Branch (@andrewbranch) |
Sorry, something went wrong.
|
We realized that declare function f<T>(): T;
const [a, b, c] = f();should really error, and this PR makes it legal (T is inferred as [any, any, any]). While it may be true that object binding patterns never contribute anything useful to type argument inference, it is not true that array binding patterns always contribute usefully to type argument inference. What we really want is for binding patterns to contribute contextual typing information to other inference sources, while never being allowed to stand on their own as inference sources. I’m going to close this and do a full revert of #45719 so we can investigate a more thorough solution in the future. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Partial revert of #45719—we now let an array binding pattern turn inference of an array into a tuple, which is really nice. I still think the behavior we were seeing for object binding patterns was undesirable, and #45846 supports that hypothesis since all the related errors were due to a tuple turning into an array.