@@ -311,3 +311,76 @@ function fx11(): { x?: number } {
311
311
>y : Symbol(y, Decl(strictSubtypeAndNarrowing.ts, 128, 24))
312
312
}
313
313
314
+ // Repros from #52827
315
+
316
+ declare function isArrayLike(value: any): value is { length: number };
317
+ >isArrayLike : Symbol(isArrayLike, Decl(strictSubtypeAndNarrowing.ts, 129, 1))
318
+ >value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 133, 29))
319
+ >value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 133, 29))
320
+ >length : Symbol(length, Decl(strictSubtypeAndNarrowing.ts, 133, 52))
321
+
322
+ function ff1(value: { [index: number]: boolean, length: number } | undefined) {
323
+ >ff1 : Symbol(ff1, Decl(strictSubtypeAndNarrowing.ts, 133, 70))
324
+ >value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 135, 13))
325
+ >index : Symbol(index, Decl(strictSubtypeAndNarrowing.ts, 135, 23))
326
+ >length : Symbol(length, Decl(strictSubtypeAndNarrowing.ts, 135, 47))
327
+
328
+ if (isArrayLike(value)) {
329
+ >isArrayLike : Symbol(isArrayLike, Decl(strictSubtypeAndNarrowing.ts, 129, 1))
330
+ >value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 135, 13))
331
+
332
+ value;
333
+ >value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 135, 13))
334
+
335
+ } else {
336
+ value;
337
+ >value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 135, 13))
338
+ }
339
+ value;
340
+ >value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 135, 13))
341
+ }
342
+
343
+ function ff2(value: { [index: number]: boolean, length: number } | string) {
344
+ >ff2 : Symbol(ff2, Decl(strictSubtypeAndNarrowing.ts, 142, 1))
345
+ >value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 144, 13))
346
+ >index : Symbol(index, Decl(strictSubtypeAndNarrowing.ts, 144, 23))
347
+ >length : Symbol(length, Decl(strictSubtypeAndNarrowing.ts, 144, 47))
348
+
349
+ if (isArrayLike(value)) {
350
+ >isArrayLike : Symbol(isArrayLike, Decl(strictSubtypeAndNarrowing.ts, 129, 1))
351
+ >value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 144, 13))
352
+
353
+ value;
354
+ >value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 144, 13))
355
+
356
+ } else {
357
+ value;
358
+ >value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 144, 13))
359
+ }
360
+ value;
361
+ >value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 144, 13))
362
+ }
363
+
364
+ function ff3(value: string | string[] | { [index: number]: boolean, length: number } | [number, boolean] | number | { length: string } | { a: string } | null | undefined) {
365
+ >ff3 : Symbol(ff3, Decl(strictSubtypeAndNarrowing.ts, 151, 1))
366
+ >value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 153, 13))
367
+ >index : Symbol(index, Decl(strictSubtypeAndNarrowing.ts, 153, 43))
368
+ >length : Symbol(length, Decl(strictSubtypeAndNarrowing.ts, 153, 67))
369
+ >length : Symbol(length, Decl(strictSubtypeAndNarrowing.ts, 153, 117))
370
+ >a : Symbol(a, Decl(strictSubtypeAndNarrowing.ts, 153, 138))
371
+
372
+ if (isArrayLike(value)) {
373
+ >isArrayLike : Symbol(isArrayLike, Decl(strictSubtypeAndNarrowing.ts, 129, 1))
374
+ >value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 153, 13))
375
+
376
+ value;
377
+ >value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 153, 13))
378
+
379
+ } else {
380
+ value;
381
+ >value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 153, 13))
382
+ }
383
+ value;
384
+ >value : Symbol(value, Decl(strictSubtypeAndNarrowing.ts, 153, 13))
385
+ }
386
+
0 commit comments