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

fix constant folding of attributes #2533

Merged
merged 2 commits into from
Nov 11, 2021

Conversation

charles-cooper
Copy link
Member

What I did

Fix #2329

How I did it

Relax a restriction on when constant folding can happen

How to verify it

See the test / compile the example in #2329

Description for the changelog

Allow constant folding of

.balance

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

```
ADDR: constant(address) = 0x000000000000000000000000000000000000dEaD
@external
def foo() -> uint256:
    return ADDR.balance
```
@codecov-commenter
Copy link

codecov-commenter commented Nov 10, 2021

Codecov Report

Merging #2533 (75b24d1) into master (9a5dd50) will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2533      +/-   ##
==========================================
+ Coverage   84.67%   84.70%   +0.02%     
==========================================
  Files          93       93              
  Lines        9301     9304       +3     
  Branches     2096     2095       -1     
==========================================
+ Hits         7876     7881       +5     
+ Misses        940      939       -1     
+ Partials      485      484       -1     
Impacted Files Coverage Δ
vyper/ast/folding.py 95.65% <ø> (+2.03%) ⬆️
vyper/old_codegen/external_call.py 94.33% <0.00%> (ø)
vyper/builtin_functions/functions.py 88.62% <0.00%> (ø)
vyper/old_codegen/parser_utils.py 83.01% <0.00%> (+0.23%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9a5dd50...75b24d1. Read the comment docs.

@charles-cooper charles-cooper merged commit bbcc2ce into vyperlang:master Nov 11, 2021
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.

Cannot access .balance of address constants
3 participants