Commit 4b32292
fix[lang]!: forbid calling
This commit forbids `extcall` and `staticcall`s to `__default__`. This
was not possible before the introduction of `__interface__()` and
`__at__()`; however, now that we have the possibility of casting
a module to its interface, it is possible to actually call the
`__default__()` function, which generates a "normal" ABI-encoded
call including the method id for `__default__()`. That could cause a
selector collision with a different function at target, and also leads
to confusing behavior (`__default__` gets called when no selector
matches).
The error message recommends the user to use `raw_call()` for this
use case.
---------
Co-authored-by: cyberthirst <[email protected]>
Co-authored-by: Charles Cooper <[email protected]>__default__ (#4371)1 parent d9444fb commit 4b32292
File tree
2 files changed
+28
-3
lines changed- tests/functional/syntax
- vyper/semantics/analysis
2 files changed
+28
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
605 | 606 | | |
606 | 607 | | |
607 | 608 | | |
608 | | - | |
609 | 609 | | |
610 | 610 | | |
611 | 611 | | |
| |||
623 | 623 | | |
624 | 624 | | |
625 | 625 | | |
626 | | - | |
627 | | - | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
628 | 648 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
775 | 775 | | |
776 | 776 | | |
777 | 777 | | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
778 | 783 | | |
779 | 784 | | |
780 | 785 | | |
| |||
0 commit comments