Repository navigation
Commit 2b0d210
authored
[ty] Centralize matched argument relations (#27705)
## Summary
Part of astral-sh/ty#3557. This is the first focused step toward
rebooting #26712 as a stack of smaller solver changes.
Introduce `ArgumentRelation` as the shared representation of a matched
argument/parameter pair and use it for generic specialization inference,
unsatisfiable-constraint diagnostic recovery, and ordinary,
positional-unpack, and keyword-unpack argument checking. Preserve
effective per-element formal types, each checking path's existing
actual-type lookup, synthetic receiver/source argument indices, gradual
variadic filtering, and existing `TypeVarTuple` handling without
changing solver behavior.
## Test plan
Added mdtests covering generic bound-method diagnostics after an
implicit receiver, positional and keyword source locations, homogeneous
and heterogeneous unpacked generic parameters, unpacked positional
element types, per-key `TypedDict` generic inference, and gradual
variadic arguments that must not affect inference.1 parent a9130f3 commit 2b0d210
3 files changed
Lines changed: 213 additions & 97 deletions
File tree
- crates/ty_python_semantic
- resources/mdtest
- call
- generics/pep695
- src/types/call
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| 21 | + | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
23 | 27 | | |
| 28 | + | |
| 29 | + | |
24 | 30 | | |
25 | 31 | | |
26 | 32 | | |
| |||
1370 | 1376 | | |
1371 | 1377 | | |
1372 | 1378 | | |
1373 | | - | |
1374 | | - | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
1375 | 1382 | | |
1376 | 1383 | | |
1377 | 1384 | | |
| |||
1390 | 1397 | | |
1391 | 1398 | | |
1392 | 1399 | | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
1393 | 1413 | | |
1394 | 1414 | | |
1395 | 1415 | | |
| |||
1593 | 1613 | | |
1594 | 1614 | | |
1595 | 1615 | | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
1596 | 1639 | | |
1597 | 1640 | | |
1598 | 1641 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1056 | 1056 | | |
1057 | 1057 | | |
1058 | 1058 | | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
1059 | 1080 | | |
1060 | 1081 | | |
1061 | 1082 | | |
| |||
0 commit comments