Commit 48d22e1
Add wrapped-return overload test cases
Summary:
**This stack**
Adds a "callable residual" type that allows us to capture structure when a generic or overloaded callable is passed to a higher-order function. The residuals can later be "exploded" to recover generic and overload structure in outputs (either Callable outputs, or classes whose methods capture the callable structure of an argument - e.g. callback protocol classes).
The full design details are [here](https://github.com/stroxler/pyrefly-docs/tree/main/callable-residuals)
**This diff**
Add tests for higher-order callables where overload residual reconstruction involves the residuals appearing
not just at the top-level of a callable but nested inside some other type, like `list[A]`.
Adding this in advance because there's already a noted tendency for agents to skip recursive traversals
and hard-code non-composable "flat" transformations unless we have guardrails in place.
Reviewed By: rchen152
Differential Revision: D102097728
fbshipit-source-id: 1a0561a8bb54464b98914b82507c86e1996ec6e11 parent 14b6b60 commit 48d22e1
1 file changed
Lines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
501 | 501 | | |
502 | 502 | | |
503 | 503 | | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
504 | 548 | | |
505 | 549 | | |
506 | 550 | | |
| |||
0 commit comments