declare class Super {
set(property:string, value:any);
}
declare class SubA extends Super {
set(property:"name", value:string);
set(property:string, value:any); // don't know why this is needed, as it should be inherited
}
declare class SubB extends Super {
set(property:"size", value:number);
set(property:string, value:any); // okay, I repeat myself.
}
interface Both extends SubA, SubB {
}
Gives me:
Error:(16, 15) TS2320: Interface 'Both' cannot simultaneously extend types 'SubA' and 'SubB'.
Named properties 'set' of types 'SubA' and 'SubB' are not identical.
I'm working with Dojo, where SubA and SubB are two Widgets and Both is the type of a mixin.
Ironically, this prevents the error:
interface Both extends SubA, SubB {
set(property:string, value:any);
}
Gives me:
Error:(16, 15) TS2320: Interface 'Both' cannot simultaneously extend types 'SubA' and 'SubB'.
Named properties 'set' of types 'SubA' and 'SubB' are not identical.
I'm working with Dojo, where
SubAandSubBare two Widgets andBothis the type of a mixin.Ironically, this prevents the error: