TypeScript/tests/cases/compiler/indexClassByNumber.ts

7 lines
184 B
TypeScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
// 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