Commit 452fa5c
fix(sol-macro): derive builtin traits on overloaded event/error enums (#1118)
The `*Events` / `*Errors` enum derive computation resolved each variant's
type name against the item table to decide whether the `#[sol(all_derives)]`
builtin traits (Debug, PartialEq, Eq, Hash) could be derived. Overloaded
items get synthetic `_N`-suffixed names (e.g. `Swap_0`, `Swap_1`) that don't
resolve as items, so the check fell through to the conservative `false` arm
and silently dropped the derives.
Compute derivability from the underlying items' parameter types (available
when building `ExpandData`) instead of from the synthetic variant type names.
Fixes alloy-rs/alloy#3856
Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>1 parent b98d12b commit 452fa5c
3 files changed
Lines changed: 68 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
579 | 579 | | |
580 | 580 | | |
581 | 581 | | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
582 | 588 | | |
583 | 589 | | |
584 | 590 | | |
| |||
645 | 651 | | |
646 | 652 | | |
647 | 653 | | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
648 | 657 | | |
649 | 658 | | |
650 | 659 | | |
| |||
659 | 668 | | |
660 | 669 | | |
661 | 670 | | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
662 | 674 | | |
663 | 675 | | |
664 | 676 | | |
| |||
676 | 688 | | |
677 | 689 | | |
678 | 690 | | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
679 | 694 | | |
680 | 695 | | |
681 | 696 | | |
| |||
918 | 933 | | |
919 | 934 | | |
920 | 935 | | |
921 | | - | |
| 936 | + | |
922 | 937 | | |
923 | 938 | | |
924 | 939 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
726 | 726 | | |
727 | 727 | | |
728 | 728 | | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
729 | 749 | | |
730 | 750 | | |
731 | 751 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
0 commit comments