Skip to content

variadic tuple types broken since 4.1.2 (same error as in 3.x.x) #41701

Description

TypeScript Version:
4.1.2 and newer

Search Terms:
rest elements, variadic tuple types

Code

type Numbers = number[];
type test = [...Numbers, string];

Expected behavior:
It should compile as it does in 4.0.5

Actual behavior:
tsc fails with the following (3.x like) error message

A rest element must be last in a tuple type.

Playground Link:
https://www.typescriptlang.org/play?ts=4.1.2#code/C4TwDgpgBAcgrgWwEYQE4GcoF4oDtEqoDaAugNwBQokUwE6w2URAdG-MmugDRQOoBLXAHNyQA

Related Issues:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions