-
-
Notifications
You must be signed in to change notification settings - Fork 788
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
Folding builtins #1949
Folding builtins #1949
Conversation
181fa49
to
fe1b920
Compare
00b54f2
to
2efda86
Compare
Codecov Report
@@ Coverage Diff @@
## master #1949 +/- ##
==========================================
- Coverage 87.04% 84.79% -2.25%
==========================================
Files 55 56 +1
Lines 6444 6642 +198
Branches 1629 1689 +60
==========================================
+ Hits 5609 5632 +23
- Misses 531 692 +161
- Partials 304 318 +14
Continue to review full report at Codecov.
|
e9b3aca
to
f6cf5bb
Compare
Lol, looks like you found a Hypothesis bug https://github.com/vyperlang/vyper/pull/1949/checks?check_run_id=651123760 |
7eb7112
to
6ba150a
Compare
6ba150a
to
71636d3
Compare
71636d3
to
82ae1af
Compare
@fubuloubu unless you have other comments I think this is ready for merging after #1956 merges. |
What I did
Add constant folding logic for builtin functions.
How I did it
evaluate
method of each class invyper/functions/functions.py
replace_builtin_functions
invyper/ast/folding.py
tests/functions/folding/
The only folding implementation I'm not testing is
method_id
. This function should always fold, so verifying the result of folding vs not-folding seems redundant. Once we add folding into the compiler process we can update the existing test cases around this function.Next Steps
Things to do next that are outside the scope of this PR.
vyper/functions/functions.py
README.md
tovyper/functions
Cute Animal Picture