function f1() { let v1: Extract = 0 as any as T; // Error let v2: Extract = 0 as any as T[K1]; // Error let v3: Extract = 0 as any as T[K1][K2]; // No error } type Foo = { x: Foo }; type Bar = { x: Bar }; function f2() { let x: Foo = 0 as any as Bar; // Error, excessive stack depth } type Foo1 = { x: Foo2 }; type Foo2 = { x: Foo1 }; function f3() { let x: Foo1 = 0 as any as Bar; // No error! }