Repository navigation
Commit cd8efe5
committed
Intern object types inferred from string literal keys
Inferring from string literals to keyof T infers to T from an object
type with an any-typed property per literal, and made a new one every
time, so inferring from the same literals twice yielded types that
could be told apart only by type id (seen in tanstack-router). They
are now interned by the literals and whether the source includes
string, which determine them.1 parent 61c1856 commit cd8efe5
2 files changed
Lines changed: 27 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
679 | 679 | | |
680 | 680 | | |
681 | 681 | | |
| 682 | + | |
682 | 683 | | |
683 | 684 | | |
684 | 685 | | |
| |||
1027 | 1028 | | |
1028 | 1029 | | |
1029 | 1030 | | |
| 1031 | + | |
1030 | 1032 | | |
1031 | 1033 | | |
1032 | 1034 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1243 | 1243 | | |
1244 | 1244 | | |
1245 | 1245 | | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
1246 | 1268 | | |
1247 | 1269 | | |
1248 | 1270 | | |
| |||
1261 | 1283 | | |
1262 | 1284 | | |
1263 | 1285 | | |
1264 | | - | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
1265 | 1289 | | |
1266 | 1290 | | |
1267 | 1291 | | |
| |||
0 commit comments