11=== tests/cases/conformance/types/conditional/inferTypesWithExtends2.ts ===
22// infer twice with different constraints (same behavior as class/interface)
3- type X10 <T> =
4- >X10 : Symbol(X10 , Decl(inferTypesWithExtends2.ts, 0, 0))
5- >T : Symbol(T, Decl(inferTypesWithExtends2.ts, 1, 9 ))
3+ type X1 <T> =
4+ >X1 : Symbol(X1 , Decl(inferTypesWithExtends2.ts, 0, 0))
5+ >T : Symbol(T, Decl(inferTypesWithExtends2.ts, 1, 8 ))
66
77 T extends { a: infer U extends string, b: infer U extends number } ? U :
8- >T : Symbol(T, Decl(inferTypesWithExtends2.ts, 1, 9 ))
8+ >T : Symbol(T, Decl(inferTypesWithExtends2.ts, 1, 8 ))
99>a : Symbol(a, Decl(inferTypesWithExtends2.ts, 2, 15))
1010>U : Symbol(U, Decl(inferTypesWithExtends2.ts, 2, 24), Decl(inferTypesWithExtends2.ts, 2, 51))
1111>b : Symbol(b, Decl(inferTypesWithExtends2.ts, 2, 42))
@@ -14,3 +14,19 @@ type X10<T> =
1414
1515 never;
1616
17+ // infer cannot reference type params in same 'extends' clause
18+ type X2<T> =
19+ >X2 : Symbol(X2, Decl(inferTypesWithExtends2.ts, 3, 10))
20+ >T : Symbol(T, Decl(inferTypesWithExtends2.ts, 6, 8))
21+
22+ T extends { a: infer U, b: infer V extends U } ? [U, V] :
23+ >T : Symbol(T, Decl(inferTypesWithExtends2.ts, 6, 8))
24+ >a : Symbol(a, Decl(inferTypesWithExtends2.ts, 7, 15))
25+ >U : Symbol(U, Decl(inferTypesWithExtends2.ts, 7, 24))
26+ >b : Symbol(b, Decl(inferTypesWithExtends2.ts, 7, 27))
27+ >V : Symbol(V, Decl(inferTypesWithExtends2.ts, 7, 36))
28+ >U : Symbol(U)
29+ >U : Symbol(U, Decl(inferTypesWithExtends2.ts, 7, 24))
30+ >V : Symbol(V, Decl(inferTypesWithExtends2.ts, 7, 36))
31+
32+ never;
0 commit comments