1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
=== tests/cases/conformance/override/override19.ts ===
type Foo = abstract new(...args: any) => any;
>Foo : abstract new (...args: any) => any
>args : any
declare function CreateMixin<C extends Foo, T extends Foo>(Context: C, Base: T): T & {
>CreateMixin : <C extends Foo, T extends Foo>(Context: C, Base: T) => T & (new (...args: any[]) => { context: InstanceType<C>;})
>Context : C
>Base : T
new (...args: any[]): { context: InstanceType<C> }
>args : any[]
>context : InstanceType<C>
}
class Context {}
>Context : Context
class A {
>A : A
doSomething() {}
>doSomething : () => void
}
class B extends CreateMixin(Context, A) {
>B : B
>CreateMixin(Context, A) : A & { context: Context; }
>CreateMixin : <C extends Foo, T extends Foo>(Context: C, Base: T) => T & (new (...args: any[]) => { context: InstanceType<C>; })
>Context : typeof Context
>A : typeof A
override foo() {} // Remove override
>foo : () => void
}
class C extends CreateMixin(Context, A) {
>C : C
>CreateMixin(Context, A) : A & { context: Context; }
>CreateMixin : <C extends Foo, T extends Foo>(Context: C, Base: T) => T & (new (...args: any[]) => { context: InstanceType<C>; })
>Context : typeof Context
>A : typeof A
override doSomethang() {} // Suggestion 'doSomething'
>doSomethang : () => void
}
|