-
Notifications
You must be signed in to change notification settings - Fork 267
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
Fixing a bug for function definition #623
base: master
Are you sure you want to change the base?
Conversation
The function defintion should start one posiiton after the end of the modifier. Given a function "function method() onlyOwner {...}', the current version of the return the definition "r{...}" instead of "{...}". I notice the same error happens when a function uses a modifier: the last character of the modifier is added to the parsed definiton. This commit fixes the bug.
Codecov Report
@@ Coverage Diff @@
## master #623 +/- ##
=======================================
Coverage 98.68% 98.68%
=======================================
Files 22 22
Lines 986 986
=======================================
Hits 973 973
Misses 13 13
Continue to review full report at Codecov.
|
Thanks so much @apanichella! (Please ignore the netlify failures ... that service doesn't work with PRs from forks atm). Could you give an example of a solidity statement which triggers this error so I can add it to the test suite and double check this? (I'm very surprised this hasn't already been reported if it's crashing function definitions with modifiers) |
Hi, pragma solidity = 0.5.16; contract Example {
} At runtime, I get three function definitions:
Actually, I think my commit does not fix the whole problem. What is the code suppsed to return for th third one? If the modifers should be simply removed, than moving the value |
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #623 +/- ##
=======================================
Coverage 98.68% 98.68%
=======================================
Files 22 22
Lines 986 986
=======================================
Hits 973 973
Misses 13 13 ☔ View full report in Codecov by Sentry. |
The function defintion should start one posiiton after the end of the modifier.
Given a function "function method() onlyOwner {...}', the current version of the return the definition "r{...}" instead of "{...}". I notice the same error happens when a function uses a modifier: the last character of the modifier is added to the parsed definiton.
This commit fixes the bug.