File tree 1 file changed +10
-8
lines changed
1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -1411,30 +1411,32 @@ function foo() {
1411
1411
return {
1412
1412
a: 1 ,
1413
1413
b: 2 ,
1414
- subInstArr: [{
1414
+ subInstArr: [
1415
+ {
1415
1416
c: 3 ,
1416
1417
d: 4
1417
- }]
1418
- }
1418
+ }
1419
+ ]
1420
+ };
1419
1421
}
1420
1422
1421
- type InstType = ReturnType < typeof foo >
1422
- type SubInstArr = InstType [' subInstArr' ];
1423
+ type InstType = ReturnType < typeof foo > ;
1424
+ type SubInstArr = InstType [" subInstArr" ];
1423
1425
type SubIsntType = SubInstArr [0 ];
1424
1426
1425
1427
let baz : SubIsntType = {
1426
1428
c: 5 ,
1427
1429
d: 6 // type checks ok!
1428
- }
1430
+ };
1429
1431
1430
1432
// You could just write a one-liner,
1431
1433
// But please make sure it is forward-readable
1432
1434
// (you can understand it from reading once left-to-right with no jumps)
1433
- type SubIsntType2 = ReturnType < typeof foo > [' subInstArr' ][0 ];
1435
+ type SubIsntType2 = ReturnType < typeof foo > [" subInstArr" ][0 ];
1434
1436
let baz2 : SubIsntType2 = {
1435
1437
c: 5 ,
1436
1438
d: 6 // type checks ok!
1437
- }
1439
+ };
1438
1440
` ` `
1439
1441
1440
1442
# Troubleshooting Handbook: Images and other non-TS/TSX files
You can’t perform that action at this time.
0 commit comments