Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: warn when payable fallback function found but no receive function #170

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

@TilakMaddy TilakMaddy marked this pull request as ready for review December 15, 2024 11:01
@TilakMaddy TilakMaddy requested a review from DaniPopes December 15, 2024 15:20
Copy link
Member

@DaniPopes DaniPopes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, I would like to hold off on this because there is currently no way to turn off warnings

crates/sema/src/typeck/mod.rs Outdated Show resolved Hide resolved
crates/sema/src/typeck/mod.rs Outdated Show resolved Hide resolved
@TilakMaddy TilakMaddy requested a review from DaniPopes February 5, 2025 17:53
@TilakMaddy TilakMaddy marked this pull request as draft February 5, 2025 17:55
@TilakMaddy TilakMaddy force-pushed the feat/payable-fallback-without-receive branch from 1ddded1 to adc0aae Compare February 5, 2025 17:56
@TilakMaddy TilakMaddy marked this pull request as ready for review February 5, 2025 17:57
contract P3 {
fallback() external payable {}

receive() external payable {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add annotations for the warnings //~

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit strange 🤔 .. I tried

  • Same line variant (//~ WARN: ...)
  • Next line variant(//~^ WARN: ...)

but they both fail on cargo uitest payable_fallback 😕

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pushed a fix 8433135
the diagnostic was missing the main span (.span()) but then it also required a workaround for a edge case in ui_test

@TilakMaddy TilakMaddy requested a review from DaniPopes February 7, 2025 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants