TypeScript/tests/cases/compiler/indexClassByNumber.ts
2014-07-12 17:30:19 -07:00

7 lines
184 B
TypeScript

// Shouldn't be able to index a class instance by a number (unless it has declared a number index signature)
class foo { }
var f = new foo();
f[0] = 4; // Shouldn't be allowed