* Handle intersection types when looking up base types for visibility * Extract protected constructor check to function and recur on intersections * Remove unneeded cast
23 lines
No EOL
382 B
TypeScript
23 lines
No EOL
382 B
TypeScript
class Abstract {
|
|
protected constructor() {
|
|
}
|
|
}
|
|
|
|
class Concrete extends Abstract {
|
|
}
|
|
|
|
type Constructor<T = {}> = new (...args: any[]) => T;
|
|
|
|
function Mixin<TBase extends Constructor>(Base: TBase) {
|
|
return class extends Base {
|
|
};
|
|
}
|
|
|
|
class Empty {
|
|
}
|
|
|
|
class CrashTrigger extends Mixin(Empty) {
|
|
public trigger() {
|
|
new Concrete();
|
|
}
|
|
} |