TypeScript/tests/baselines/reference/numericIndexerConstraint1.js
2015-02-06 18:45:09 -08:00

16 lines
338 B
JavaScript

//// [numericIndexerConstraint1.ts]
class Foo { foo() { } }
var x: { [index: string]: number; };
var result: Foo = x["one"]; // error
//// [numericIndexerConstraint1.js]
var Foo = (function () {
function Foo() {
}
Foo.prototype.foo = function () { };
return Foo;
})();
var x;
var result = x["one"]; // error