Closed
Description
Between 0.9.1 and 0.9.5 the explicit indexer was removed from Object. Between 1.0 and 1.1, code that adds the indexer back to Object causes type comparison failures:
interface Object {
[key:string]:any;
}
interface Foo {}
function a(b:Object) {}
var foo:Foo;
a(foo); // error TS2345: Argument of type 'Foo' is not assignable to parameter of type 'Object'.
Putting an indexer on Foo makes it work.
This is probably an OK error since adding back the indexer like this to Object should probably be considered an anti-pattern, and since in ES5 you can create inheritance patterns that don’t extend from Object, but it should at least be documented as a known breaking change.