Commit 978348b
committed
fix: trait default-body placeholder overwrites real signature, breaking deriving
The parser emits two TraitItem::Method entries for a method with both
a signature and a default body: the signature (TypeKind::Named) and a
placeholder (TypeKind::Hole). The skip guard in register_trait_methods
tested for TypeKind::Named("_") which never matched TypeKind::Hole,
so the placeholder overwrote the real signature with an unquantified
type variable. The first call site pinned it; the second failed with
'type mismatch'. This also broke deriving for any trait with a default
body at 2+ types.
Fix: match TypeKind::Hole in the skip guard. Two regression tests.1 parent a3441a1 commit 978348b
2 files changed
Lines changed: 71 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9026 | 9026 | | |
9027 | 9027 | | |
9028 | 9028 | | |
9029 | | - | |
9030 | | - | |
9031 | | - | |
9032 | | - | |
9033 | | - | |
| 9029 | + | |
| 9030 | + | |
| 9031 | + | |
| 9032 | + | |
| 9033 | + | |
| 9034 | + | |
| 9035 | + | |
| 9036 | + | |
| 9037 | + | |
| 9038 | + | |
| 9039 | + | |
| 9040 | + | |
| 9041 | + | |
| 9042 | + | |
9034 | 9043 | | |
9035 | 9044 | | |
9036 | 9045 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
625 | 625 | | |
626 | 626 | | |
627 | 627 | | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
0 commit comments