Repository navigation
Commit e27d0b0
committed
added implicit receivers
emit one positional-only marker for a receiver callable
any `/` the arguments emit — explicit, or implied by a bare positional
followed by a named parameter — already closes off the receiver, so the
protocol form was rendering two and producing invalid python
fix implicit receiver review findings
- a scope that binds the name shadows an outer receiver callable, as it
would shadow an ordinary load; `x.fn()` no longer resolves past a local
binding and silently lowers to a call of it
- reject a trailing lambda block that rebinds `it` and uses its receiver's
members: the lowering reads them from `it`
- guard the receiver-callable parse arm with the recursion limit its
sibling arms use
- widen the synthesized protocol receiver parameter name past any
parameter the callable declares itself
- name the receiver in a missing-argument diagnostic
render and traverse the implicit receiver everywhere
codegen dropped the receiver when unparsing a callable type, and
`any_over_expr` never visited it. adds formatter, parser and codegen
round-trip coverage for the surface syntax1 parent 9592449 commit e27d0b0
39 files changed
Lines changed: 1589 additions & 76 deletions
File tree
- crates
- by_transforms
- src
- transforms
- tests
- common
- ruff_python_ast
- src
- visitor
- ruff_python_codegen/src
- ruff_python_formatter
- resources/test/fixtures/ruff
- tests/snapshots
- ruff_python_parser/src/parser
- snapshots
- ty_python_semantic
- resources/mdtest
- src
- types
- call
- infer
- builder
- docs/basedpython/features
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
| 493 | + | |
493 | 494 | | |
494 | 495 | | |
495 | 496 | | |
| |||
594 | 595 | | |
595 | 596 | | |
596 | 597 | | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
597 | 603 | | |
598 | 604 | | |
599 | 605 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
311 | 311 | | |
312 | 312 | | |
313 | 313 | | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
314 | 318 | | |
315 | 319 | | |
316 | 320 | | |
317 | 321 | | |
318 | 322 | | |
319 | 323 | | |
| 324 | + | |
320 | 325 | | |
321 | 326 | | |
322 | 327 | | |
| |||
339 | 344 | | |
340 | 345 | | |
341 | 346 | | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
342 | 356 | | |
343 | 357 | | |
344 | 358 | | |
| |||
485 | 499 | | |
486 | 500 | | |
487 | 501 | | |
488 | | - | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
489 | 511 | | |
490 | 512 | | |
491 | 513 | | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | 514 | | |
498 | | - | |
| 515 | + | |
| 516 | + | |
499 | 517 | | |
500 | 518 | | |
501 | 519 | | |
502 | 520 | | |
503 | 521 | | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
504 | 530 | | |
505 | 531 | | |
506 | 532 | | |
507 | 533 | | |
508 | 534 | | |
| 535 | + | |
509 | 536 | | |
510 | 537 | | |
511 | 538 | | |
| |||
514 | 541 | | |
515 | 542 | | |
516 | 543 | | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
517 | 547 | | |
518 | 548 | | |
519 | 549 | | |
| |||
522 | 552 | | |
523 | 553 | | |
524 | 554 | | |
525 | | - | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
526 | 561 | | |
527 | | - | |
| 562 | + | |
528 | 563 | | |
529 | | - | |
530 | | - | |
531 | | - | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
532 | 568 | | |
533 | 569 | | |
534 | 570 | | |
| |||
691 | 727 | | |
692 | 728 | | |
693 | 729 | | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
694 | 761 | | |
695 | 762 | | |
696 | 763 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
388 | 388 | | |
389 | 389 | | |
390 | 390 | | |
391 | | - | |
| 391 | + | |
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
| |||
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
402 | | - | |
| 402 | + | |
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
904 | 904 | | |
905 | 905 | | |
906 | 906 | | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
907 | 910 | | |
908 | 911 | | |
909 | 912 | | |
| |||
0 commit comments