Skip to content

Type alias circularly references itself error #1968

@mjbvz

Description

@mjbvz

Steps to reproduce

type IndentationTree<L> = TopNode<L> | VirtualNode<L> | LineNode<L> | BlankNode<L>;
type IndentationSubTree<L> = Exclude<IndentationTree<L>, TopNode<L>>;

interface NodeBase<L> {
	subs: IndentationSubTree<L>[];
}

interface VirtualNode<L> extends NodeBase<L> {
	type: 'virtual';
}

interface TopNode<L> extends NodeBase<L> {
	type: 'top';
}

interface LineNode<L> extends NodeBase<L> {
	type: 'line';
}

interface BlankNode<L> extends NodeBase<L> {
	type: 'blank';
}

Behavior with typescript@5.8

No errors in 5.8.3

Behavior with tsgo

This is an error in tsgo

Image

Metadata

Metadata

Assignees

Labels

Domain: Type CheckingRelated to type checking, grammar checkingType OrderingAn issue related to ordering of types

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions