Commit ab2bdd7
committed
Fix IndexError when unpacking empty tuple in type alias
When expanding type arguments for a builtins.tuple instance, the
normalization code accessed args[0] without checking if args was
non-empty. This caused an IndexError when Unpack[tuple[()]] was used
in a type alias, since the empty tuple expansion produces zero args.
Fixes #209131 parent 1d8ddd5 commit ab2bdd7
2 files changed
+36
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
227 | 231 | | |
228 | 232 | | |
229 | 233 | | |
| |||
519 | 523 | | |
520 | 524 | | |
521 | 525 | | |
522 | | - | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
523 | 535 | | |
524 | 536 | | |
525 | 537 | | |
| |||
530 | 542 | | |
531 | 543 | | |
532 | 544 | | |
533 | | - | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
534 | 554 | | |
535 | 555 | | |
536 | 556 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2237 | 2237 | | |
2238 | 2238 | | |
2239 | 2239 | | |
| 2240 | + | |
| 2241 | + | |
| 2242 | + | |
| 2243 | + | |
| 2244 | + | |
| 2245 | + | |
| 2246 | + | |
| 2247 | + | |
| 2248 | + | |
| 2249 | + | |
| 2250 | + | |
| 2251 | + | |
| 2252 | + | |
| 2253 | + | |
0 commit comments