Why does this TypeScript mixin employing generics fail to compile?
问题 I'm using mixins/traits with TypeScript using a subclass factory pattern as described at https://mariusschulz.com/blog/mixin-classes-in-typescript. The trait in question is called Identifiable , which imparts an id property to a class that should express the Identifiable trait. When I attempt to use the trait with another, non-generic trait ( Nameable ) in a certain order, compilation fails. class Empty {} type ctor<T = Empty> = new(...args: any[]) => T; function Nameable<T extends ctor =