2014-07-13 01:04:16 +02:00
|
|
|
//// [objectLiteralIndexerErrors.ts]
|
|
|
|
interface A {
|
|
|
|
x: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface B extends A {
|
|
|
|
y: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
var a: A;
|
|
|
|
var b: B;
|
|
|
|
var c: any;
|
|
|
|
|
|
|
|
var o1: { [s: string]: A;[n: number]: B; } = { x: b, 0: a }; // both indexers are A
|
|
|
|
o1 = { x: c, 0: a }; // string indexer is any, number indexer is A
|
|
|
|
|
|
|
|
//// [objectLiteralIndexerErrors.js]
|
|
|
|
var a;
|
|
|
|
var b;
|
|
|
|
var c;
|
2014-08-15 22:18:54 +02:00
|
|
|
var o1 = { x: b, 0: a }; // both indexers are A
|
2014-08-16 00:49:09 +02:00
|
|
|
o1 = { x: c, 0: a }; // string indexer is any, number indexer is A
|