2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/numericIndexerConstraint4.ts ===
|
|
|
|
class A {
|
|
|
|
>A : A
|
|
|
|
|
|
|
|
foo: number;
|
|
|
|
>foo : number
|
|
|
|
}
|
|
|
|
|
|
|
|
class B extends A {
|
|
|
|
>B : B
|
|
|
|
>A : A
|
|
|
|
|
|
|
|
bar: string;
|
|
|
|
>bar : string
|
|
|
|
}
|
|
|
|
|
|
|
|
var x: {
|
2014-12-06 01:58:49 +01:00
|
|
|
>x : { [idx: number]: A; }
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
[idx: number]: A;
|
|
|
|
>idx : number
|
|
|
|
>A : A
|
|
|
|
|
|
|
|
} = { data: new B() }
|
2014-10-13 15:56:58 +02:00
|
|
|
>{ data: new B() } : { [x: number]: undefined; data: B; }
|
2014-08-15 23:33:16 +02:00
|
|
|
>data : B
|
|
|
|
>new B() : B
|
|
|
|
>B : typeof B
|
|
|
|
|