Skip to content

stack overflow in recursive type alias + lookup type #14837

@HerringtonDarkholme

Description

@HerringtonDarkholme

Extracted from #14833

TypeScript Version: 2.2.1 / nightly (2.2.0-dev.201xxxxx)

Code

type Foo<T extends "true", B> = { "true": Foo<T, Foo<T, B>> }[T];
let f: Foo<"true", {}> = null!;

Expected behavior:
An error reporting cyclic dependency.

Actual behavior:

Throw RangeError: Maximum call stack size exceeded

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