//// [infiniteExpansionThroughTypeInference.ts] interface G { x: G> // infinitely expanding type reference y: T } function ff(g: G): void { ff(g) // when infering T here we need to make sure to not descend into the structure of G infinitely } //// [infiniteExpansionThroughTypeInference.js] function ff(g) { ff(g); }