Uh oh!
There was an error while loading. Please reload this page.
Better typings for Array.concat() - #33606
Closed
Jack Bates (jablko) wants to merge 2 commits into
Closed
Conversation
Jessica Franco (Jessidhia)
suggested changes
Sep 26, 2019
Jessica Franco (Jessidhia)
left a comment
There was a problem hiding this comment.
You probably need to keep at least the less-generic overload around as the first overload.
As it is, the free U parameter will prevent inference from working in cases where one is trying to build a homogeneous array; especially when the array includes function or object types that might have methods.
constfoo=[(a: string)=>a]constbar=foo.concat(b=>b)// implicit any errorJack Bates (jablko)force-pushed
the
patch-9
branch
2 times, most recently
from
September 27, 2019 17:54
337078d to
eb23428CompareJack Bates (jablko)
commented
Sep 27, 2019
ContributorAuthor
Jessica Franco (@Jessidhia) Thank you for this feedback! I've now updated the PR accordingly. |
Jack Bates (jablko)force-pushed
the
patch-9
branch
2 times, most recently
from
October 3, 2019 17:16
34b5a8e to
d24988cCompareJack Bates (jablko)force-pushed
the
patch-9
branch
3 times, most recently
from
October 9, 2019 16:37
47ac9d2 to
2d8c8eaCompareJack Bates (jablko)force-pushed
the
patch-9
branch
2 times, most recently
from
October 19, 2019 18:34
944ef0f to
0693442CompareJack Bates (jablko)force-pushed
the
patch-9
branch
from
October 27, 2019 19:15
0693442 to
dbcc955CompareJack Bates (jablko)force-pushed
the
patch-9
branch
from
November 4, 2019 15:21
dbcc955 to
0768269CompareJack Bates (jablko)force-pushed
the
patch-9
branch
2 times, most recently
from
November 16, 2019 15:24
5336214 to
40063feCompareJack Bates (jablko)force-pushed
the
patch-9
branch
5 times, most recently
from
November 28, 2019 14:51
50c57c6 to
3ec86d2CompareJack Bates (jablko)force-pushed
the
patch-9
branch
from
November 29, 2019 22:25
3ec86d2 to
9bb99b7CompareJack Bates (jablko)force-pushed
the
patch-9
branch
from
December 28, 2019 17:09
9bb99b7 to
e7612dbCompareJack Bates (jablko)force-pushed
the
patch-9
branch
3 times, most recently
from
January 25, 2020 20:23
cbf4fc2 to
dd89dbeCompareJack Bates (jablko)force-pushed
the
patch-9
branch
from
January 29, 2020 01:06
dd89dbe to
bc574c1CompareRyan Cavanaugh (RyanCavanaugh)
commented
Jan 31, 2020
Member
Rolled into #33645 |
TypeScript Bot (typescript-bot)
commented
Oct 21, 2025
Contributor
The TypeScript team hasn't accepted the linked issue #26378. If you can get it accepted, this PR will have a better chance of being reviewed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes#26378
Fixes#26976