Skip to content

Conversation

@ahejlsberg
Copy link
Member

Fixes #40235.

@typescript-bot typescript-bot added the For Milestone Bug PRs that fix a bug with a specific milestone label Aug 25, 2020
@ahejlsberg
Copy link
Member Author

@typescript-bot test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 25, 2020

Heya @ahejlsberg, I've started to run the extended test suite on this PR at 355706d. You can monitor the build here.

@ahejlsberg
Copy link
Member Author

Although unrelated to PR, checking to see if stricter circular recursion check in type inference can fix RWC OOM.

@ahejlsberg
Copy link
Member Author

@typescript-bot test this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 25, 2020

Heya @ahejlsberg, I've started to run the extended test suite on this PR at 80e6df6. You can monitor the build here.

type U2 = [...[string, ...Numbers], boolean];
~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS1256: A rest element must be last in a tuple type.
type U3 = [...[string, number], boolean];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I get this right, does this mean we still have (or bring back) the constraint that a rest element must be at last in a tuple?
In 4.0 doc, I can see the below update:

The second change is that rest elements can occur anywhere in a tuple - not just at the end!
Previously, TypeScript would issue an error like the following:
But with TypeScript 4.0, this restriction is relaxed.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ahejlsberg ahejlsberg merged commit cea1cfb into master Sep 8, 2020
@ahejlsberg ahejlsberg deleted the fix40235 branch September 8, 2020 17:14
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Milestone Bug PRs that fix a bug with a specific milestone

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

unbounded type is not strict

5 participants