27 lines
721 B
Text
27 lines
721 B
Text
|
==== tests/cases/compiler/inheritedStringIndexersFromDifferentBaseTypes2.ts (1 errors) ====
|
||
|
// indexer in B is a subtype of indexer in A
|
||
|
interface A {
|
||
|
[s: string]: {
|
||
|
a;
|
||
|
};
|
||
|
}
|
||
|
interface B {
|
||
|
[s: number]: {
|
||
|
a;
|
||
|
b;
|
||
|
};
|
||
|
}
|
||
|
interface C extends A, B { } // ok
|
||
|
|
||
|
interface D {
|
||
|
[s: number]: {};
|
||
|
}
|
||
|
interface E extends A, D { } // error
|
||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||
|
!!! Numeric index type '{}' is not assignable to string index type '{ a: any; }'.
|
||
|
|
||
|
interface F extends A, D {
|
||
|
[s: number]: {
|
||
|
a;
|
||
|
};
|
||
|
} // ok because we overrode D's number index signature
|