mirror of
https://github.com/swc-project/swc.git
synced 2024-12-28 08:04:43 +03:00
21 lines
477 B
TypeScript
21 lines
477 B
TypeScript
// @target: esnext
|
|
// @noImplicitOverride: true
|
|
|
|
type Foo = abstract new(...args: any) => any;
|
|
declare function CreateMixin<C extends Foo, T extends Foo>(Context: C, Base: T): T & {
|
|
new (...args: any[]): { context: InstanceType<C> }
|
|
}
|
|
class Context {}
|
|
|
|
class A {
|
|
doSomething() {}
|
|
}
|
|
|
|
class B extends CreateMixin(Context, A) {
|
|
override foo() {} // Remove override
|
|
}
|
|
|
|
class C extends CreateMixin(Context, A) {
|
|
override doSomethang() {} // Suggestion 'doSomething'
|
|
}
|