=== tests/cases/compiler/complexClassRelationships.ts === // There should be no errors in this file class Derived extends Base { >Derived : Derived >Base : Base public static createEmpty(): Derived { >createEmpty : () => Derived >Derived : Derived var item = new Derived(); >item : Derived >new Derived() : Derived >Derived : typeof Derived return item; >item : Derived } } class BaseCollection { >BaseCollection : BaseCollection >T : T >Base : Base constructor(f: () => T) { >f : () => T >T : T (item: Thing) => { return [item.Components]; }; >(item: Thing) => { return [item.Components]; } : (item: Thing) => ComponentCollection[] >item : Thing >Thing : Thing >[item.Components] : ComponentCollection[] >item.Components : ComponentCollection >item : Thing >Components : ComponentCollection } } class Base { >Base : Base ownerCollection: BaseCollection; >ownerCollection : BaseCollection >BaseCollection : BaseCollection >Base : Base } class Thing { >Thing : Thing public get Components(): ComponentCollection { return null } >Components : ComponentCollection >ComponentCollection : ComponentCollection >null : null } class ComponentCollection { >ComponentCollection : ComponentCollection >T : T private static sortComponents(p: Foo) { >sortComponents : (p: Foo) => GenericType >p : Foo >Foo : Foo return p.prop1; >p.prop1 : GenericType >p : Foo >prop1 : GenericType } } class Foo { >Foo : Foo public get prop1() { >prop1 : GenericType return new GenericType(this); >new GenericType(this) : GenericType >GenericType : typeof GenericType >this : Foo } public populate() { >populate : () => void this.prop2; >this.prop2 : BaseCollection >this : Foo >prop2 : BaseCollection } public get prop2(): BaseCollection { >prop2 : BaseCollection >BaseCollection : BaseCollection >Derived : Derived return new BaseCollection(Derived.createEmpty); >new BaseCollection(Derived.createEmpty) : BaseCollection >BaseCollection : typeof BaseCollection >Derived : Derived >Derived.createEmpty : () => Derived >Derived : typeof Derived >createEmpty : () => Derived } } class GenericType { >GenericType : GenericType >T : T constructor(parent: FooBase) { } >parent : FooBase >FooBase : FooBase } class FooBase { >FooBase : FooBase public populate() { >populate : () => void } }