Is it possible to extend such as way?
export interface IClass<T extends ISubject> {
subject : T;
course : ICourse<T>;
}
export interface ICourse<T> extends T { }
export interface ISubject { }
Where a ClassRoom can implement IClass that teaches Math, English. However, the course should be relevant to the Subject. Such that, Math will have the following courses: MAT101, MAT205 etc. and English has ENG232, ENG302 etc..
This way they are tightly coupled to their respective interface. Ie. you should not be able to pass in subject as Math and course as ENG232
Currently it complains at extends T for the ICourse interface as: An interface can only extend an object type or intersection of object types with statically known members.