30 lines
397 B
Text
30 lines
397 B
Text
|
=== 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: {
|
||
|
>x : { [x: number]: A; }
|
||
|
|
||
|
[idx: number]: A;
|
||
|
>idx : number
|
||
|
>A : A
|
||
|
|
||
|
} = { data: new B() }
|
||
|
>{ data: new B() } : { [x: number]: A; data: B; }
|
||
|
>data : B
|
||
|
>new B() : B
|
||
|
>B : typeof B
|
||
|
|