mirror of
https://github.com/swc-project/swc.git
synced 2024-12-28 08:04:43 +03:00
29 lines
558 B
TypeScript
29 lines
558 B
TypeScript
interface Base {
|
|
[x: number]: { x: number; y: number; };
|
|
[x: string]: { x: number; }
|
|
}
|
|
|
|
interface Derived extends Base {
|
|
1: { y: number } // error
|
|
}
|
|
|
|
interface Derived2 extends Base {
|
|
'1': { y: number } // error
|
|
}
|
|
|
|
interface Derived3 extends Base {
|
|
foo: { y: number } // error
|
|
}
|
|
|
|
interface Derived4 extends Base {
|
|
foo(): { x: number } // error
|
|
}
|
|
|
|
// satisifies string indexer but not numeric indexer
|
|
interface Derived5 extends Base {
|
|
1: { x: number } // error
|
|
}
|
|
|
|
interface Derived5 extends Base {
|
|
'1': { x: number } // error
|
|
} |