@@ -34,3 +34,67 @@ function f<X>(arg: X) {
34
34
>x : Symbol(x, Decl(identicalGenericConditionalsWithInferRelated.ts, 4, 7))
35
35
}
36
36
37
+ // repro from https://github.com/microsoft/TypeScript/issues/26627
38
+ export type Constructor<T> = new (...args: any[]) => T
39
+ >Constructor : Symbol(Constructor, Decl(identicalGenericConditionalsWithInferRelated.ts, 8, 1))
40
+ >T : Symbol(T, Decl(identicalGenericConditionalsWithInferRelated.ts, 11, 24))
41
+ >args : Symbol(args, Decl(identicalGenericConditionalsWithInferRelated.ts, 11, 34))
42
+ >T : Symbol(T, Decl(identicalGenericConditionalsWithInferRelated.ts, 11, 24))
43
+
44
+ export type MappedResult<T> =
45
+ >MappedResult : Symbol(MappedResult, Decl(identicalGenericConditionalsWithInferRelated.ts, 11, 54))
46
+ >T : Symbol(T, Decl(identicalGenericConditionalsWithInferRelated.ts, 12, 25))
47
+
48
+ T extends Boolean ? boolean :
49
+ >T : Symbol(T, Decl(identicalGenericConditionalsWithInferRelated.ts, 12, 25))
50
+ >Boolean : Symbol(Boolean, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
51
+
52
+ T extends Number ? number :
53
+ >T : Symbol(T, Decl(identicalGenericConditionalsWithInferRelated.ts, 12, 25))
54
+ >Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
55
+
56
+ T extends String ? string :
57
+ >T : Symbol(T, Decl(identicalGenericConditionalsWithInferRelated.ts, 12, 25))
58
+ >String : Symbol(String, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
59
+
60
+ T
61
+ >T : Symbol(T, Decl(identicalGenericConditionalsWithInferRelated.ts, 12, 25))
62
+
63
+
64
+ interface X {
65
+ >X : Symbol(X, Decl(identicalGenericConditionalsWithInferRelated.ts, 16, 5))
66
+
67
+ decode<C extends Constructor<any>>(ctor: C): MappedResult<C extends Constructor<infer T> ? T : never>
68
+ >decode : Symbol(X.decode, Decl(identicalGenericConditionalsWithInferRelated.ts, 19, 13))
69
+ >C : Symbol(C, Decl(identicalGenericConditionalsWithInferRelated.ts, 20, 11))
70
+ >Constructor : Symbol(Constructor, Decl(identicalGenericConditionalsWithInferRelated.ts, 8, 1))
71
+ >ctor : Symbol(ctor, Decl(identicalGenericConditionalsWithInferRelated.ts, 20, 39))
72
+ >C : Symbol(C, Decl(identicalGenericConditionalsWithInferRelated.ts, 20, 11))
73
+ >MappedResult : Symbol(MappedResult, Decl(identicalGenericConditionalsWithInferRelated.ts, 11, 54))
74
+ >C : Symbol(C, Decl(identicalGenericConditionalsWithInferRelated.ts, 20, 11))
75
+ >Constructor : Symbol(Constructor, Decl(identicalGenericConditionalsWithInferRelated.ts, 8, 1))
76
+ >T : Symbol(T, Decl(identicalGenericConditionalsWithInferRelated.ts, 20, 89))
77
+ >T : Symbol(T, Decl(identicalGenericConditionalsWithInferRelated.ts, 20, 89))
78
+ }
79
+
80
+ class Y implements X {
81
+ >Y : Symbol(Y, Decl(identicalGenericConditionalsWithInferRelated.ts, 21, 1))
82
+ >X : Symbol(X, Decl(identicalGenericConditionalsWithInferRelated.ts, 16, 5))
83
+
84
+ decode<C extends Constructor<any>>(ctor: C): MappedResult<C extends Constructor<infer T> ? T : never> {
85
+ >decode : Symbol(Y.decode, Decl(identicalGenericConditionalsWithInferRelated.ts, 23, 22))
86
+ >C : Symbol(C, Decl(identicalGenericConditionalsWithInferRelated.ts, 24, 11))
87
+ >Constructor : Symbol(Constructor, Decl(identicalGenericConditionalsWithInferRelated.ts, 8, 1))
88
+ >ctor : Symbol(ctor, Decl(identicalGenericConditionalsWithInferRelated.ts, 24, 39))
89
+ >C : Symbol(C, Decl(identicalGenericConditionalsWithInferRelated.ts, 24, 11))
90
+ >MappedResult : Symbol(MappedResult, Decl(identicalGenericConditionalsWithInferRelated.ts, 11, 54))
91
+ >C : Symbol(C, Decl(identicalGenericConditionalsWithInferRelated.ts, 24, 11))
92
+ >Constructor : Symbol(Constructor, Decl(identicalGenericConditionalsWithInferRelated.ts, 8, 1))
93
+ >T : Symbol(T, Decl(identicalGenericConditionalsWithInferRelated.ts, 24, 89))
94
+ >T : Symbol(T, Decl(identicalGenericConditionalsWithInferRelated.ts, 24, 89))
95
+
96
+ throw new Error()
97
+ >Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
98
+ }
99
+ }
100
+
0 commit comments