2014-07-13 01:04:16 +02:00
|
|
|
//// [numericIndexerConstraint1.ts]
|
|
|
|
class Foo { foo() { } }
|
|
|
|
var x: { [index: string]: number; };
|
|
|
|
var result: Foo = x["one"]; // error
|
|
|
|
|
|
|
|
|
|
|
|
//// [numericIndexerConstraint1.js]
|
|
|
|
var Foo = (function () {
|
|
|
|
function Foo() {
|
|
|
|
}
|
2015-02-07 03:45:09 +01:00
|
|
|
Foo.prototype.foo = function () { };
|
2014-07-13 01:04:16 +02:00
|
|
|
return Foo;
|
|
|
|
})();
|
|
|
|
var x;
|
2014-08-15 22:18:54 +02:00
|
|
|
var result = x["one"]; // error
|