2014-07-13 01:04:16 +02:00
|
|
|
//// [augmentedTypeAssignmentCompatIndexSignature.ts]
|
|
|
|
interface Foo { a }
|
|
|
|
interface Bar { b }
|
|
|
|
|
|
|
|
interface Object {
|
|
|
|
[n: number]: Foo;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface Function {
|
|
|
|
[n: number]: Bar;
|
|
|
|
}
|
|
|
|
|
|
|
|
var o = {};
|
|
|
|
var f = () => { };
|
|
|
|
|
|
|
|
var v1: {
|
|
|
|
[n: number]: Foo
|
|
|
|
} = o; // Should be allowed
|
|
|
|
|
|
|
|
var v2: {
|
|
|
|
[n: number]: Bar
|
|
|
|
} = f; // Should be allowed
|
|
|
|
|
|
|
|
//// [augmentedTypeAssignmentCompatIndexSignature.js]
|
|
|
|
var o = {};
|
|
|
|
var f = function () {
|
|
|
|
};
|
2014-08-15 22:18:54 +02:00
|
|
|
var v1 = o; // Should be allowed
|
2014-08-15 23:32:08 +02:00
|
|
|
var v2 = f; // Should be allowed
|