forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharrayConcat2.js
45 lines (34 loc) · 939 Bytes
/
arrayConcat2.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//// [arrayConcat2.ts]
var a: string[] = [];
a.concat("hello", 'world');
a.concat('Hello');
var b = new Array<string>();
b.concat('hello');
const expected1: undefined = undefined as Flatten<undefined>;
// #19535
let [actual2] = (undefined as unknown as string[][]).concat([""]);
const expected2: string | string[] = actual2;
actual2 = undefined as unknown as string | string[];
// #26378
let [actual3] = [""].concat([1]);
const expected3: string | number = actual3;
actual3 = undefined as unknown as string | number;
// #26976
[].concat([""]);
//// [arrayConcat2.js]
var a = [];
a.concat("hello", 'world');
a.concat('Hello');
var b = new Array();
b.concat('hello');
var expected1 = undefined;
// #19535
var actual2 = undefined.concat([""])[0];
var expected2 = actual2;
actual2 = undefined;
// #26378
var actual3 = [""].concat([1])[0];
var expected3 = actual3;
actual3 = undefined;
// #26976
[].concat([""]);