mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
Update baselines with new index signature rules
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user