TypeScript/tests/baselines/reference/indexClassByNumber.types
2015-04-15 16:44:20 -07:00

19 lines
368 B
Plaintext

=== tests/cases/compiler/indexClassByNumber.ts ===
// Shouldn't be able to index a class instance by a number (unless it has declared a number index signature)
class foo { }
>foo : foo
var f = new foo();
>f : foo
>new foo() : foo
>foo : typeof foo
f[0] = 4; // Shouldn't be allowed
>f[0] = 4 : number
>f[0] : any
>f : foo
>0 : number
>4 : number