2014-09-06 03:42:05 +02:00
|
|
|
=== tests/cases/conformance/types/members/augmentedTypeBracketAccessIndexSignature.ts ===
|
2014-08-15 23:33:16 +02:00
|
|
|
interface Foo { a }
|
|
|
|
>Foo : Foo
|
|
|
|
>a : any
|
|
|
|
|
|
|
|
interface Bar { b }
|
|
|
|
>Bar : Bar
|
|
|
|
>b : any
|
|
|
|
|
|
|
|
interface Object {
|
|
|
|
>Object : Object
|
|
|
|
|
|
|
|
[n: number]: Foo;
|
|
|
|
>n : number
|
|
|
|
>Foo : Foo
|
|
|
|
}
|
|
|
|
|
|
|
|
interface Function {
|
|
|
|
>Function : Function
|
|
|
|
|
|
|
|
[n: number]: Bar;
|
|
|
|
>n : number
|
|
|
|
>Bar : Bar
|
|
|
|
}
|
|
|
|
|
|
|
|
var a = {}[0]; // Should be Foo
|
|
|
|
>a : any
|
|
|
|
>{}[0] : any
|
|
|
|
>{} : {}
|
|
|
|
|
|
|
|
var b = (() => { })[0]; // Should be Bar
|
|
|
|
>b : any
|
|
|
|
>(() => { })[0] : any
|
|
|
|
>(() => { }) : () => void
|
|
|
|
>() => { } : () => void
|
|
|
|
|