Skip to content

Commit 1366cc7

Browse files
committed
Accept new baselines
1 parent ee59cee commit 1366cc7

File tree

4 files changed

+57
-0
lines changed

4 files changed

+57
-0
lines changed

tests/baselines/reference/conditionalTypes2.errors.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,4 +267,10 @@ tests/cases/conformance/types/conditional/conditionalTypes2.ts(75,12): error TS2
267267
};
268268
type PCCA = ProductComplementComplement['a'];
269269
type PCCB = ProductComplementComplement['b'];
270+
271+
// Repro from #31326
272+
273+
type Hmm<T, U extends T> = U extends T ? { [K in keyof U]: number } : never;
274+
type What = Hmm<{}, { a: string }>
275+
const w: What = { a: 4 };
270276

tests/baselines/reference/conditionalTypes2.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,12 @@ type ProductComplementComplement = {
188188
};
189189
type PCCA = ProductComplementComplement['a'];
190190
type PCCB = ProductComplementComplement['b'];
191+
192+
// Repro from #31326
193+
194+
type Hmm<T, U extends T> = U extends T ? { [K in keyof U]: number } : never;
195+
type What = Hmm<{}, { a: string }>
196+
const w: What = { a: 4 };
191197

192198

193199
//// [conditionalTypes2.js]
@@ -265,6 +271,7 @@ function foo(value) {
265271
toString2(value);
266272
}
267273
}
274+
var w = { a: 4 };
268275

269276

270277
//// [conditionalTypes2.d.ts]
@@ -392,3 +399,10 @@ declare type ProductComplementComplement = {
392399
};
393400
declare type PCCA = ProductComplementComplement['a'];
394401
declare type PCCB = ProductComplementComplement['b'];
402+
declare type Hmm<T, U extends T> = U extends T ? {
403+
[K in keyof U]: number;
404+
} : never;
405+
declare type What = Hmm<{}, {
406+
a: string;
407+
}>;
408+
declare const w: What;

tests/baselines/reference/conditionalTypes2.symbols

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,3 +685,25 @@ type PCCB = ProductComplementComplement['b'];
685685
>PCCB : Symbol(PCCB, Decl(conditionalTypes2.ts, 187, 45))
686686
>ProductComplementComplement : Symbol(ProductComplementComplement, Decl(conditionalTypes2.ts, 181, 34))
687687

688+
// Repro from #31326
689+
690+
type Hmm<T, U extends T> = U extends T ? { [K in keyof U]: number } : never;
691+
>Hmm : Symbol(Hmm, Decl(conditionalTypes2.ts, 188, 45))
692+
>T : Symbol(T, Decl(conditionalTypes2.ts, 192, 9))
693+
>U : Symbol(U, Decl(conditionalTypes2.ts, 192, 11))
694+
>T : Symbol(T, Decl(conditionalTypes2.ts, 192, 9))
695+
>U : Symbol(U, Decl(conditionalTypes2.ts, 192, 11))
696+
>T : Symbol(T, Decl(conditionalTypes2.ts, 192, 9))
697+
>K : Symbol(K, Decl(conditionalTypes2.ts, 192, 44))
698+
>U : Symbol(U, Decl(conditionalTypes2.ts, 192, 11))
699+
700+
type What = Hmm<{}, { a: string }>
701+
>What : Symbol(What, Decl(conditionalTypes2.ts, 192, 76))
702+
>Hmm : Symbol(Hmm, Decl(conditionalTypes2.ts, 188, 45))
703+
>a : Symbol(a, Decl(conditionalTypes2.ts, 193, 21))
704+
705+
const w: What = { a: 4 };
706+
>w : Symbol(w, Decl(conditionalTypes2.ts, 194, 5))
707+
>What : Symbol(What, Decl(conditionalTypes2.ts, 192, 76))
708+
>a : Symbol(a, Decl(conditionalTypes2.ts, 194, 17))
709+

tests/baselines/reference/conditionalTypes2.types

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,3 +431,18 @@ type PCCA = ProductComplementComplement['a'];
431431
type PCCB = ProductComplementComplement['b'];
432432
>PCCB : Product<"b", 1>
433433

434+
// Repro from #31326
435+
436+
type Hmm<T, U extends T> = U extends T ? { [K in keyof U]: number } : never;
437+
>Hmm : Hmm<T, U>
438+
439+
type What = Hmm<{}, { a: string }>
440+
>What : { a: number; }
441+
>a : string
442+
443+
const w: What = { a: 4 };
444+
>w : { a: number; }
445+
>{ a: 4 } : { a: number; }
446+
>a : number
447+
>4 : 4
448+

0 commit comments

Comments
 (0)