GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Make tuples have known length by KiaraGrouwstra · Pull Request #17765 · microsoft/TypeScript Conversation
|
|
Shouldn't the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
practically it doesn't have to be, consider: interface X { length: 0; } |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
It hadn't occurred to me; |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I'd probably add Note that for dumb reasons, |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@isiahmeadows: Yeah, changed it. I feel a bit on the fence about #13347; I hope assignability from this |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
tuple-array assignability blocked by microsoft#17765
fa530ff to
1f77317
Compare
strictTuples flag giving tuples known length
|
Update: should be good now, ready for feedback. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Travis randomly complaining: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Tests should be fixed by ivogabe/gulp-typescript#536. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Merged for retry, Travis seems good again. Thanks Ika (@ikatyang). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I like this change, but I'm going to try implementing tuple-freshness first to see if it works well too.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if (strictTuples) { | ||
| const lengthSymbol = createSymbol(SymbolFlags.Property, "length" as __String); | ||
| lengthSymbol.type = getLiteralType(arity); | ||
| lengthSymbol.checkFlags = CheckFlags.Readonly; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I don't see how adding Readonly helps if the type is literally 2, because only 2 can be assigned to it. If the intent is future-proofing in case Readonly will someday propagate through assignments, I think that it's as likely to harm as it is to help.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Yeah, fair enough. I had no special intentions in adding it. Feel free to adjust as you see fit! :)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Given that the total impact of this change is 3 good breaks (firebase, leaflet and highcharts), plus incorrect array syntax (9), I think that it is small enough to ship without a flag. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
We had one more meeting, and decided to ship this PR without a flag and without |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @tycho01! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Nathan Shively-Sanders (@sandersn) please add a note about this change in the breaking change section for TS 2.7. We need also some guidance for the firebase use case |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hooray! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@tycho01 Nathan Shively-Sanders (@sandersn) you are the best! Thank you! Nathan Shively-Sanders (@sandersn) now this should unblock #5453, right? :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
strictTuples flag giving tuples known length|
Thanks for the merge! At this rate I may get the motivation to finish those last few PRs too. :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This should be added to the January release notes roadmap. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Michael De Abreu (@michaeljota) I added it to the roadmap. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Proposal: strict and open-length tuple types
There was an error while loading. Please reload this page.