Update baselines with new index signature rules

This commit is contained in:
Nathan Shively-Sanders
2016-10-21 16:27:32 -07:00
parent fdfb159024
commit ff92afd47b
12 changed files with 175 additions and 318 deletions

View File

@@ -35,14 +35,12 @@ let getter: { a: number, c: number } =
{ ...op, c: 7 }
getter.a = 12;
// null, undefined, functions and primitives besides string result in { }
// null, undefined, functions and primitives result in { }
let spreadNull = { ...null };
let spreadUndefind = { ...undefined };
let spreadNum = { ...12 };
let spreadBool = { ...false };
let spreadFunc = { ...(function () { }) };
// strings get a numeric indexer: [n: number]: string
let spreadStr = { ...'foo' };
// methods are not enumerable

View File

@@ -2,6 +2,7 @@ class C {
a: number;
c: boolean;
}
// index signatures are not allowed in object literals with spread types
let c: { ...C, b: string, c?: string, [n: number]: string };
let n: number = c.a;
let s: string = c[12];