This commit is contained in:
Andrew Branch 2023-11-16 16:50:03 -08:00
Родитель d088733b24
Коммит 85c7e7a552
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 22CCA4B120C427D2
4 изменённых файлов: 12 добавлений и 11 удалений

Просмотреть файл

@ -258,6 +258,7 @@ declare let o2: {
readonly d: () => void;
};
declare let o3: {
readonly [x: string]: 10 | 1 | 2 | 3 | 20 | (() => void) | 4;
readonly a: 1;
readonly b: 2;
readonly c: 3;

Просмотреть файл

@ -202,9 +202,9 @@ let o2 = { a: 1, 'b': 2, ['c']: 3, d() {}, ['e' + '']: 4 } as const;
>4 : 4
let o3 = { ...o1, ...o2 } as const;
>o3 : { readonly a: 1; readonly b: 2; readonly c: 3; readonly d: () => void; readonly x: 10; readonly y: 20; }
>{ ...o1, ...o2 } as const : { readonly a: 1; readonly b: 2; readonly c: 3; readonly d: () => void; readonly x: 10; readonly y: 20; }
>{ ...o1, ...o2 } : { readonly a: 1; readonly b: 2; readonly c: 3; readonly d: () => void; readonly x: 10; readonly y: 20; }
>o3 : { readonly [x: string]: 10 | 1 | 2 | 3 | 20 | (() => void) | 4; readonly a: 1; readonly b: 2; readonly c: 3; readonly d: () => void; readonly x: 10; readonly y: 20; }
>{ ...o1, ...o2 } as const : { readonly [x: string]: 10 | 1 | 2 | 3 | 20 | (() => void) | 4; readonly a: 1; readonly b: 2; readonly c: 3; readonly d: () => void; readonly x: 10; readonly y: 20; }
>{ ...o1, ...o2 } : { readonly [x: string]: 10 | 1 | 2 | 3 | 20 | (() => void) | 4; readonly a: 1; readonly b: 2; readonly c: 3; readonly d: () => void; readonly x: 10; readonly y: 20; }
>o1 : { readonly x: 10; readonly y: 20; }
>o2 : { readonly [x: string]: 1 | 2 | 3 | (() => void) | 4; readonly a: 1; readonly b: 2; readonly c: 3; readonly d: () => void; }

Просмотреть файл

@ -17,24 +17,24 @@ function f() {
>a : any
const o1 = { ...{}, [n]: n };
>o1 : {}
>{ ...{}, [n]: n } : {}
>o1 : { [x: number]: number; }
>{ ...{}, [n]: n } : { [x: number]: number; }
>{} : {}
>[n] : number
>n : number
>n : number
const o2 = { ...{}, [a]: n };
>o2 : {}
>{ ...{}, [a]: n } : {}
>o2 : { [x: number]: number; }
>{ ...{}, [a]: n } : { [x: number]: number; }
>{} : {}
>[a] : number
>a : any
>n : number
const o3 = { [a]: n, ...{}, [n]: n, ...{}, [m]: m };
>o3 : {}
>{ [a]: n, ...{}, [n]: n, ...{}, [m]: m } : {}
>o3 : { [x: number]: number; }
>{ [a]: n, ...{}, [n]: n, ...{}, [m]: m } : { [x: number]: number; }
>[a] : number
>a : any
>n : number

Просмотреть файл

@ -5,8 +5,8 @@ export class C {
>C : C
public a = { b: this.b, ...this.c, [this.b]: `${this.c}`};
>a : { c: number; b: number; }
>{ b: this.b, ...this.c, [this.b]: `${this.c}`} : { c: number; b: number; }
>a : { [x: number]: string; c: number; b: number; }
>{ b: this.b, ...this.c, [this.b]: `${this.c}`} : { [x: number]: string; c: number; b: number; }
>b : number
>this.b : number
>this : this