Commit a110500
authored
Nowarn receiver of extension taking params (#23351)
Fixes #23349
Extensions are regular methods, but the "receiver" parameter is exempt
from the unused check. By error, previously `x.m` was exempt but not
`x.f(y)`.
(The reason for the exemption may be that the method expressed as a
member of the receiver type may make no reference to `this`, without
warning.)
Check for parameters used only in default arg expressions. A parameter
may be aliased in a default arg getter method, so a usage of that getter
param counts as a usage of the method param (or class param). Defaults
of class params are found in the class companion.File tree
3 files changed
+56
-9
lines changed- compiler/src/dotty/tools/dotc/transform
- tests/warn
3 files changed
+56
-9
lines changedLines changed: 25 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
530 | 530 | | |
531 | 531 | | |
532 | 532 | | |
533 | | - | |
| 533 | + | |
534 | 534 | | |
535 | 535 | | |
536 | 536 | | |
537 | 537 | | |
538 | | - | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
539 | 542 | | |
540 | 543 | | |
541 | 544 | | |
| |||
544 | 547 | | |
545 | 548 | | |
546 | 549 | | |
547 | | - | |
548 | | - | |
549 | | - | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
550 | 553 | | |
551 | | - | |
| 554 | + | |
552 | 555 | | |
553 | 556 | | |
| 557 | + | |
554 | 558 | | |
555 | 559 | | |
556 | 560 | | |
| |||
562 | 566 | | |
563 | 567 | | |
564 | 568 | | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
565 | 579 | | |
566 | 580 | | |
567 | 581 | | |
| |||
591 | 605 | | |
592 | 606 | | |
593 | 607 | | |
594 | | - | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
595 | 612 | | |
596 | | - | |
| 613 | + | |
597 | 614 | | |
598 | 615 | | |
599 | 616 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
0 commit comments