-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
FixedA PR has been merged for this issueA PR has been merged for this issueSuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
Description
I have a piece of code with many foo[]
s that should really be [foo,foo]
-- it would be nicer if map
had a type that preserves tuples, so something like this:
var x: [number, number];
x = [1,2].map(x=>x+1);
would work, even if it's some hack with a union of tuples up to some number of elements (I think that I saw something like that around rest arguments, and I imagine that this in a close neighborhood).
I thought that this would be common, but didn't find anything about it. Feel free to dismiss if it is.
Metadata
Metadata
Assignees
Labels
FixedA PR has been merged for this issueA PR has been merged for this issueSuggestionAn idea for TypeScriptAn idea for TypeScript