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: public constant arrays #3536

Merged
merged 3 commits into from
Jul 25, 2023

Conversation

charles-cooper
Copy link
Member

@charles-cooper charles-cooper commented Jul 25, 2023

What I did

fix #3535

How I did it

move ast expansion to before local validation

How to verify it

Commit message

public getters for arrays would panic at codegen because type
information for the array members was not available. this is because
type annotation would occur before getter expansion. this commit moves
the type annotation phase to right before getter expansion, so that the
generated ast nodes will get annotated.

it also fixes a small bug when trying to deepcopy the nodes generated by
ast expansion - the generated nodes have no node_id and raise an
exception when deepcopy tries to perform `__eq__` between two of the
generated FunctionDefs.

Description for the changelog

Cute Animal Picture

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

move ast expansion to before local validation
@charles-cooper charles-cooper changed the title fix public constant annotation fix public constants Jul 25, 2023
@charles-cooper charles-cooper changed the title fix public constants fix public constant arrays Jul 25, 2023
node_id is not generated for ast nodes generated manually (like those in
vyper.ast.expansion)
@codecov-commenter
Copy link

codecov-commenter commented Jul 25, 2023

Codecov Report

Merging #3536 (4a7314c) into master (019a37a) will decrease coverage by 2.49%.
Report is 1 commits behind head on master.
The diff coverage is 100.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##           master    #3536      +/-   ##
==========================================
- Coverage   89.15%   86.67%   -2.49%     
==========================================
  Files          85       85              
  Lines       11346    11362      +16     
  Branches     2577     2584       +7     
==========================================
- Hits        10116     9848     -268     
- Misses        811     1059     +248     
- Partials      419      455      +36     
Files Changed Coverage Δ
vyper/ast/expansion.py 95.23% <ø> (-0.12%) ⬇️
vyper/compiler/phases.py 92.30% <ø> (-0.06%) ⬇️
vyper/ast/nodes.py 92.36% <100.00%> (-1.53%) ⬇️
vyper/semantics/analysis/__init__.py 100.00% <100.00%> (ø)

... and 15 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@charles-cooper charles-cooper requested a review from fubuloubu July 25, 2023 22:53
@charles-cooper charles-cooper marked this pull request as ready for review July 25, 2023 22:53
@charles-cooper charles-cooper changed the title fix public constant arrays fix: public constant arrays Jul 25, 2023
@charles-cooper charles-cooper enabled auto-merge (squash) July 25, 2023 23:00
@charles-cooper charles-cooper merged commit 2f39e69 into vyperlang:master Jul 25, 2023
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.

compile panic with public constant arrays
3 participants