Skip to content

Commit d9933c8

Browse files
committed
Accepting new baselines
1 parent 139b554 commit d9933c8

6 files changed

Lines changed: 310 additions & 0 deletions
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//// [recursiveGenericUnionType1.ts]
2+
declare module Test1 {
3+
export type Container<T> = T | {
4+
[i: string]: Container<T>;
5+
};
6+
export type IStringContainer = Container<string>;
7+
}
8+
9+
declare module Test2 {
10+
export type Container<T> = T | {
11+
[i: string]: Container<T>;
12+
};
13+
export type IStringContainer = Container<string>;
14+
}
15+
16+
var x: Test1.Container<number>;
17+
18+
var s1: Test1.IStringContainer;
19+
var s2: Test2.IStringContainer;
20+
s1 = s2;
21+
s2 = s1;
22+
23+
24+
//// [recursiveGenericUnionType1.js]
25+
var x;
26+
var s1;
27+
var s2;
28+
s1 = s2;
29+
s2 = s1;
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
=== tests/cases/compiler/recursiveGenericUnionType1.ts ===
2+
declare module Test1 {
3+
>Test1 : Symbol(Test1, Decl(recursiveGenericUnionType1.ts, 0, 0))
4+
5+
export type Container<T> = T | {
6+
>Container : Symbol(Container, Decl(recursiveGenericUnionType1.ts, 0, 22))
7+
>T : Symbol(T, Decl(recursiveGenericUnionType1.ts, 1, 26))
8+
>T : Symbol(T, Decl(recursiveGenericUnionType1.ts, 1, 26))
9+
10+
[i: string]: Container<T>;
11+
>i : Symbol(i, Decl(recursiveGenericUnionType1.ts, 2, 9))
12+
>Container : Symbol(Container, Decl(recursiveGenericUnionType1.ts, 0, 22))
13+
>T : Symbol(T, Decl(recursiveGenericUnionType1.ts, 1, 26))
14+
15+
};
16+
export type IStringContainer = Container<string>;
17+
>IStringContainer : Symbol(IStringContainer, Decl(recursiveGenericUnionType1.ts, 3, 6))
18+
>Container : Symbol(Container, Decl(recursiveGenericUnionType1.ts, 0, 22))
19+
}
20+
21+
declare module Test2 {
22+
>Test2 : Symbol(Test2, Decl(recursiveGenericUnionType1.ts, 5, 1))
23+
24+
export type Container<T> = T | {
25+
>Container : Symbol(Container, Decl(recursiveGenericUnionType1.ts, 7, 22))
26+
>T : Symbol(T, Decl(recursiveGenericUnionType1.ts, 8, 26))
27+
>T : Symbol(T, Decl(recursiveGenericUnionType1.ts, 8, 26))
28+
29+
[i: string]: Container<T>;
30+
>i : Symbol(i, Decl(recursiveGenericUnionType1.ts, 9, 9))
31+
>Container : Symbol(Container, Decl(recursiveGenericUnionType1.ts, 7, 22))
32+
>T : Symbol(T, Decl(recursiveGenericUnionType1.ts, 8, 26))
33+
34+
};
35+
export type IStringContainer = Container<string>;
36+
>IStringContainer : Symbol(IStringContainer, Decl(recursiveGenericUnionType1.ts, 10, 6))
37+
>Container : Symbol(Container, Decl(recursiveGenericUnionType1.ts, 7, 22))
38+
}
39+
40+
var x: Test1.Container<number>;
41+
>x : Symbol(x, Decl(recursiveGenericUnionType1.ts, 14, 3))
42+
>Test1 : Symbol(Test1, Decl(recursiveGenericUnionType1.ts, 0, 0))
43+
>Container : Symbol(Test1.Container, Decl(recursiveGenericUnionType1.ts, 0, 22))
44+
45+
var s1: Test1.IStringContainer;
46+
>s1 : Symbol(s1, Decl(recursiveGenericUnionType1.ts, 16, 3))
47+
>Test1 : Symbol(Test1, Decl(recursiveGenericUnionType1.ts, 0, 0))
48+
>IStringContainer : Symbol(Test1.IStringContainer, Decl(recursiveGenericUnionType1.ts, 3, 6))
49+
50+
var s2: Test2.IStringContainer;
51+
>s2 : Symbol(s2, Decl(recursiveGenericUnionType1.ts, 17, 3))
52+
>Test2 : Symbol(Test2, Decl(recursiveGenericUnionType1.ts, 5, 1))
53+
>IStringContainer : Symbol(Test2.IStringContainer, Decl(recursiveGenericUnionType1.ts, 10, 6))
54+
55+
s1 = s2;
56+
>s1 : Symbol(s1, Decl(recursiveGenericUnionType1.ts, 16, 3))
57+
>s2 : Symbol(s2, Decl(recursiveGenericUnionType1.ts, 17, 3))
58+
59+
s2 = s1;
60+
>s2 : Symbol(s2, Decl(recursiveGenericUnionType1.ts, 17, 3))
61+
>s1 : Symbol(s1, Decl(recursiveGenericUnionType1.ts, 16, 3))
62+
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
=== tests/cases/compiler/recursiveGenericUnionType1.ts ===
2+
declare module Test1 {
3+
>Test1 : any
4+
5+
export type Container<T> = T | {
6+
>Container : T | { [i: string]: T | any; }
7+
>T : T
8+
>T : T
9+
10+
[i: string]: Container<T>;
11+
>i : string
12+
>Container : T | { [i: string]: T | any; }
13+
>T : T
14+
15+
};
16+
export type IStringContainer = Container<string>;
17+
>IStringContainer : string | { [i: string]: string | any; }
18+
>Container : T | { [i: string]: T | any; }
19+
}
20+
21+
declare module Test2 {
22+
>Test2 : any
23+
24+
export type Container<T> = T | {
25+
>Container : T | { [i: string]: T | any; }
26+
>T : T
27+
>T : T
28+
29+
[i: string]: Container<T>;
30+
>i : string
31+
>Container : T | { [i: string]: T | any; }
32+
>T : T
33+
34+
};
35+
export type IStringContainer = Container<string>;
36+
>IStringContainer : string | { [i: string]: string | any; }
37+
>Container : T | { [i: string]: T | any; }
38+
}
39+
40+
var x: Test1.Container<number>;
41+
>x : number | { [i: string]: number | any; }
42+
>Test1 : any
43+
>Container : T | { [i: string]: T | any; }
44+
45+
var s1: Test1.IStringContainer;
46+
>s1 : string | { [i: string]: string | any; }
47+
>Test1 : any
48+
>IStringContainer : string | { [i: string]: string | any; }
49+
50+
var s2: Test2.IStringContainer;
51+
>s2 : string | { [i: string]: string | any; }
52+
>Test2 : any
53+
>IStringContainer : string | { [i: string]: string | any; }
54+
55+
s1 = s2;
56+
>s1 = s2 : string | { [i: string]: string | any; }
57+
>s1 : string | { [i: string]: string | any; }
58+
>s2 : string | { [i: string]: string | any; }
59+
60+
s2 = s1;
61+
>s2 = s1 : string | { [i: string]: string | any; }
62+
>s2 : string | { [i: string]: string | any; }
63+
>s1 : string | { [i: string]: string | any; }
64+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//// [recursiveGenericUnionType2.ts]
2+
declare module Test1 {
3+
export type Container<T> = T | {
4+
[i: string]: Container<T>[];
5+
};
6+
export type IStringContainer = Container<string>;
7+
}
8+
9+
declare module Test2 {
10+
export type Container<T> = T | {
11+
[i: string]: Container<T>[];
12+
};
13+
export type IStringContainer = Container<string>;
14+
}
15+
16+
var x: Test1.Container<number>;
17+
18+
var s1: Test1.IStringContainer;
19+
var s2: Test2.IStringContainer;
20+
s1 = s2;
21+
s2 = s1;
22+
23+
24+
//// [recursiveGenericUnionType2.js]
25+
var x;
26+
var s1;
27+
var s2;
28+
s1 = s2;
29+
s2 = s1;
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
=== tests/cases/compiler/recursiveGenericUnionType2.ts ===
2+
declare module Test1 {
3+
>Test1 : Symbol(Test1, Decl(recursiveGenericUnionType2.ts, 0, 0))
4+
5+
export type Container<T> = T | {
6+
>Container : Symbol(Container, Decl(recursiveGenericUnionType2.ts, 0, 22))
7+
>T : Symbol(T, Decl(recursiveGenericUnionType2.ts, 1, 26))
8+
>T : Symbol(T, Decl(recursiveGenericUnionType2.ts, 1, 26))
9+
10+
[i: string]: Container<T>[];
11+
>i : Symbol(i, Decl(recursiveGenericUnionType2.ts, 2, 9))
12+
>Container : Symbol(Container, Decl(recursiveGenericUnionType2.ts, 0, 22))
13+
>T : Symbol(T, Decl(recursiveGenericUnionType2.ts, 1, 26))
14+
15+
};
16+
export type IStringContainer = Container<string>;
17+
>IStringContainer : Symbol(IStringContainer, Decl(recursiveGenericUnionType2.ts, 3, 6))
18+
>Container : Symbol(Container, Decl(recursiveGenericUnionType2.ts, 0, 22))
19+
}
20+
21+
declare module Test2 {
22+
>Test2 : Symbol(Test2, Decl(recursiveGenericUnionType2.ts, 5, 1))
23+
24+
export type Container<T> = T | {
25+
>Container : Symbol(Container, Decl(recursiveGenericUnionType2.ts, 7, 22))
26+
>T : Symbol(T, Decl(recursiveGenericUnionType2.ts, 8, 26))
27+
>T : Symbol(T, Decl(recursiveGenericUnionType2.ts, 8, 26))
28+
29+
[i: string]: Container<T>[];
30+
>i : Symbol(i, Decl(recursiveGenericUnionType2.ts, 9, 9))
31+
>Container : Symbol(Container, Decl(recursiveGenericUnionType2.ts, 7, 22))
32+
>T : Symbol(T, Decl(recursiveGenericUnionType2.ts, 8, 26))
33+
34+
};
35+
export type IStringContainer = Container<string>;
36+
>IStringContainer : Symbol(IStringContainer, Decl(recursiveGenericUnionType2.ts, 10, 6))
37+
>Container : Symbol(Container, Decl(recursiveGenericUnionType2.ts, 7, 22))
38+
}
39+
40+
var x: Test1.Container<number>;
41+
>x : Symbol(x, Decl(recursiveGenericUnionType2.ts, 14, 3))
42+
>Test1 : Symbol(Test1, Decl(recursiveGenericUnionType2.ts, 0, 0))
43+
>Container : Symbol(Test1.Container, Decl(recursiveGenericUnionType2.ts, 0, 22))
44+
45+
var s1: Test1.IStringContainer;
46+
>s1 : Symbol(s1, Decl(recursiveGenericUnionType2.ts, 16, 3))
47+
>Test1 : Symbol(Test1, Decl(recursiveGenericUnionType2.ts, 0, 0))
48+
>IStringContainer : Symbol(Test1.IStringContainer, Decl(recursiveGenericUnionType2.ts, 3, 6))
49+
50+
var s2: Test2.IStringContainer;
51+
>s2 : Symbol(s2, Decl(recursiveGenericUnionType2.ts, 17, 3))
52+
>Test2 : Symbol(Test2, Decl(recursiveGenericUnionType2.ts, 5, 1))
53+
>IStringContainer : Symbol(Test2.IStringContainer, Decl(recursiveGenericUnionType2.ts, 10, 6))
54+
55+
s1 = s2;
56+
>s1 : Symbol(s1, Decl(recursiveGenericUnionType2.ts, 16, 3))
57+
>s2 : Symbol(s2, Decl(recursiveGenericUnionType2.ts, 17, 3))
58+
59+
s2 = s1;
60+
>s2 : Symbol(s2, Decl(recursiveGenericUnionType2.ts, 17, 3))
61+
>s1 : Symbol(s1, Decl(recursiveGenericUnionType2.ts, 16, 3))
62+
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
=== tests/cases/compiler/recursiveGenericUnionType2.ts ===
2+
declare module Test1 {
3+
>Test1 : any
4+
5+
export type Container<T> = T | {
6+
>Container : T | { [i: string]: (T | any)[]; }
7+
>T : T
8+
>T : T
9+
10+
[i: string]: Container<T>[];
11+
>i : string
12+
>Container : T | { [i: string]: (T | any)[]; }
13+
>T : T
14+
15+
};
16+
export type IStringContainer = Container<string>;
17+
>IStringContainer : string | { [i: string]: (string | any)[]; }
18+
>Container : T | { [i: string]: (T | any)[]; }
19+
}
20+
21+
declare module Test2 {
22+
>Test2 : any
23+
24+
export type Container<T> = T | {
25+
>Container : T | { [i: string]: (T | any)[]; }
26+
>T : T
27+
>T : T
28+
29+
[i: string]: Container<T>[];
30+
>i : string
31+
>Container : T | { [i: string]: (T | any)[]; }
32+
>T : T
33+
34+
};
35+
export type IStringContainer = Container<string>;
36+
>IStringContainer : string | { [i: string]: (string | any)[]; }
37+
>Container : T | { [i: string]: (T | any)[]; }
38+
}
39+
40+
var x: Test1.Container<number>;
41+
>x : number | { [i: string]: (number | any)[]; }
42+
>Test1 : any
43+
>Container : T | { [i: string]: (T | any)[]; }
44+
45+
var s1: Test1.IStringContainer;
46+
>s1 : string | { [i: string]: (string | any)[]; }
47+
>Test1 : any
48+
>IStringContainer : string | { [i: string]: (string | any)[]; }
49+
50+
var s2: Test2.IStringContainer;
51+
>s2 : string | { [i: string]: (string | any)[]; }
52+
>Test2 : any
53+
>IStringContainer : string | { [i: string]: (string | any)[]; }
54+
55+
s1 = s2;
56+
>s1 = s2 : string | { [i: string]: (string | any)[]; }
57+
>s1 : string | { [i: string]: (string | any)[]; }
58+
>s2 : string | { [i: string]: (string | any)[]; }
59+
60+
s2 = s1;
61+
>s2 = s1 : string | { [i: string]: (string | any)[]; }
62+
>s2 : string | { [i: string]: (string | any)[]; }
63+
>s1 : string | { [i: string]: (string | any)[]; }
64+

0 commit comments

Comments
 (0)