Skip to content

Stack overflow when assigning types with mutually recursive tuple-typed properties #4473

@DanielRosenwasser

Description

@DanielRosenwasser
interface Tree1 {
    children: [Tree1, Tree2];
}

interface Tree2 {
    children: [Tree2, Tree1];
}

let tree1: Tree1;
let tree2: Tree2;
tree1 = tree2;
tree2 = tree1;

Basically either of the last two assignments trigger the stack overflow.

The following example also triggers the issue. Notice that both element types in Tree2 are also of type Tree2.

interface Tree1 {
    children: [Tree1, Tree2];
}

interface Tree2 {
    children: [Tree2, Tree2];
}

let tree1: Tree1;
let tree2: Tree2;
tree1 = tree2;
tree2 = tree1;

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions