forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathissue52912.types
More file actions
91 lines (73 loc) · 1.78 KB
/
issue52912.types
File metadata and controls
91 lines (73 loc) · 1.78 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
//// [tests/cases/compiler/issue52912.ts] ////
=== issue52912.ts ===
// Repro from #52912
type Source1 = { array: Source2[] };
>Source1 : Source1
> : ^^^^^^^
>array : Source2[]
> : ^^^^^^^^^
type Source2 = { array: Source3[] };
>Source2 : Source2
> : ^^^^^^^
>array : Source3[]
> : ^^^^^^^^^
type Source3 = { array: Source4[] };
>Source3 : Source3
> : ^^^^^^^
>array : Source4[]
> : ^^^^^^^^^
type Source4 = {};
>Source4 : Source4
> : ^^^^^^^
type Target1 = { array: Target2[] };
>Target1 : Target1
> : ^^^^^^^
>array : Target2[]
> : ^^^^^^^^^
type Target2 = { array: Target3[] };
>Target2 : Target2
> : ^^^^^^^
>array : Target3[]
> : ^^^^^^^^^
type Target3 = { array: Target4[] };
>Target3 : Target3
> : ^^^^^^^
>array : Target4[]
> : ^^^^^^^^^
type Target4 = { someNewProperty: string };
>Target4 : Target4
> : ^^^^^^^
>someNewProperty : string
> : ^^^^^^
declare const source1: Source1;
>source1 : Source1
> : ^^^^^^^
declare const source2: Source2;
>source2 : Source2
> : ^^^^^^^
declare const source3: Source3;
>source3 : Source3
> : ^^^^^^^
declare const source4: Source4;
>source4 : Source4
> : ^^^^^^^
const target1: Target1 = source1; // Error
>target1 : Target1
> : ^^^^^^^
>source1 : Source1
> : ^^^^^^^
const target2: Target2 = source2; // Error
>target2 : Target2
> : ^^^^^^^
>source2 : Source2
> : ^^^^^^^
const target3: Target3 = source3; // Error
>target3 : Target3
> : ^^^^^^^
>source3 : Source3
> : ^^^^^^^
const target4: Target4 = source4; // Error
>target4 : Target4
> : ^^^^^^^
>source4 : Source4
> : ^^^^^^^