Solving The Specific Issue You can use a type assertion to tell the compiler that you know better: public clone(): any { var cloneObj = new (this.constructor() as any); for (var attribut in this) { if (typeof this[attribut] === "object") { cloneObj[attribut] = this[attribut].clone(); } else { cloneObj[attribut] = this[attribut]; } } return cloneObj; } Cloning As of 2022, there is a proposal to all
