=== tests/cases/compiler/genericClasses4.ts === // once caused stack overflow class Vec2_T >Vec2_T : Vec2_T >A : A { constructor(public x: A, public y: A) { } >x : A >A : A >y : A >A : A fmap(f: (a: A) => B): Vec2_T { >fmap : (f: (a: A) => B) => Vec2_T >B : B >f : (a: A) => B >a : A >A : A >B : B >Vec2_T : Vec2_T >B : B var x:B = f(this.x); >x : B >B : B >f(this.x) : B >f : (a: A) => B >this.x : A >this : Vec2_T >x : A var y:B = f(this.y); >y : B >B : B >f(this.y) : B >f : (a: A) => B >this.y : A >this : Vec2_T >y : A var retval: Vec2_T = new Vec2_T(x, y); >retval : Vec2_T >Vec2_T : Vec2_T >B : B >new Vec2_T(x, y) : Vec2_T >Vec2_T : typeof Vec2_T >x : B >y : B return retval; >retval : Vec2_T } apply(f: Vec2_T<(a: A) => B>): Vec2_T { >apply : (f: Vec2_T<(a: A) => B>) => Vec2_T >B : B >f : Vec2_T<(a: A) => B> >Vec2_T : Vec2_T >a : A >A : A >B : B >Vec2_T : Vec2_T >B : B var x:B = f.x(this.x); >x : B >B : B >f.x(this.x) : B >f.x : (a: A) => B >f : Vec2_T<(a: A) => B> >x : (a: A) => B >this.x : A >this : Vec2_T >x : A var y:B = f.y(this.y); >y : B >B : B >f.y(this.y) : B >f.y : (a: A) => B >f : Vec2_T<(a: A) => B> >y : (a: A) => B >this.y : A >this : Vec2_T >y : A var retval: Vec2_T = new Vec2_T(x, y); >retval : Vec2_T >Vec2_T : Vec2_T >B : B >new Vec2_T(x, y) : Vec2_T >Vec2_T : typeof Vec2_T >x : B >y : B return retval; >retval : Vec2_T } }