-
-
Notifications
You must be signed in to change notification settings - Fork 793
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
Add explicit error message when specifying default_return_value on void function call #3121
Add explicit error message when specifying default_return_value on void function call #3121
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there any case where require_return=
should not be set to true?
Not for the |
Codecov Report
@@ Coverage Diff @@
## master #3121 +/- ##
==========================================
- Coverage 88.49% 88.21% -0.28%
==========================================
Files 95 95
Lines 10758 10762 +4
Branches 2554 2267 -287
==========================================
- Hits 9520 9494 -26
- Misses 796 829 +33
+ Partials 442 439 -3
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Co-authored-by: Charles Cooper <cooper.charles.m@gmail.com>
What I did
When specifying the
default_return_value
on a call to a void external function, the compiler currently only returns the following error messageAttributeError: 'NoneType' object has no attribute 'compare_type'
.I added a more explicit exception so that the error can be caught and addressed more easily.
How I did it
I added a check for a return type when
default_return_value
is set. If there's no return type, anArgumentException
is raised.How to verify it
Compiling this contract:
will now generate the following error:
Commit message
Exception when setting default_return_value on void function call
Description for the changelog
Add explicit error message when specifying default_return_value on void function call
Cute Animal Picture