-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Open
Labels
Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.
Description
TypeScript Version: 4.0.2
Search Terms: spread tuple in recursive tuple type
Code
I'm trying to model a type that could evaluate to any of the following:
["list", "of", "Post"];
["list", "of", "list", "of", "Post"];
["list", "of", "list", "of", "list", "of", "Post"];
// ... could go onThe following approach produces a circularity error, even though tuple types are circularity-capable since 3.7 :/
type Nested = ["list", "of", ...(["Post"] | Nested)];Expected behavior:
To be able to type-check the following (for example):
const nested: Nested = ["list", "of", "list", "of", "Post"];Actual behavior:
Circularity error.
Any help would be greatly appreciated! Thank you!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.