Skip to content

chore[test]: add test for struct member names#3527

Merged
charles-cooper merged 12 commits intovyperlang:masterfrom
tserg:fix/address_members_as_struct
Mar 17, 2025
Merged

chore[test]: add test for struct member names#3527
charles-cooper merged 12 commits intovyperlang:masterfrom
tserg:fix/address_members_as_struct

Conversation

@tserg
Copy link
Copy Markdown
Contributor

@tserg tserg commented Jul 20, 2023

What I did

Fix #3521.

How I did it

Remove the else branch in parse_Attribute so that structs can be catched.

How to verify it

See test.

Commit message

since 7bdebbf12798ccda42, address member names are no longer reserved,
and can be used as struct names. this commit adds a test for the new
behavior.

Description for the changelog

Allow address members' names as struct fields.

Cute Animal Picture

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

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jul 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.26%. Comparing base (579dd57) to head (0000edc).
Report is 82 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3527      +/-   ##
==========================================
+ Coverage   92.24%   92.26%   +0.02%     
==========================================
  Files         123      123              
  Lines       17500    17500              
  Branches     2960     2960              
==========================================
+ Hits        16142    16146       +4     
  Misses        946      946              
+ Partials      412      408       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@charles-cooper
Copy link
Copy Markdown
Member

i think reserving those attributes to not be available on structs/enums is kind of ok.

@charles-cooper
Copy link
Copy Markdown
Member

but yea, maybe it's useful sometimes to have structs with information like some_user.balance, some_user.codesize etc

@charles-cooper
Copy link
Copy Markdown
Member

@tserg the original issue was fixed in 7bdebbf, but it would be good to get these tests in. could you please isolate this PR to update the tests?

@tserg tserg changed the title fix: allow address members' names as struct fields chore[test]: add test for address members' names as struct fields Dec 30, 2024
@tserg tserg requested a review from charles-cooper December 31, 2024 05:20
@charles-cooper
Copy link
Copy Markdown
Member

@tserg could you update to the new kwarg syntax?

@tserg
Copy link
Copy Markdown
Contributor Author

tserg commented Feb 20, 2025

Done!

Copy link
Copy Markdown
Member

@charles-cooper charles-cooper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, tagging @cyberthirst to check as well

@charles-cooper charles-cooper self-assigned this Feb 21, 2025
@charles-cooper charles-cooper requested review from cyberthirst and removed request for cyberthirst March 14, 2025 12:39
@charles-cooper charles-cooper added this to the v0.4.2 milestone Mar 15, 2025
@charles-cooper charles-cooper added the release - must release blocker label Mar 17, 2025
@charles-cooper charles-cooper changed the title chore[test]: add test for address members' names as struct fields chore[test]: add test for struct member names Mar 17, 2025
@charles-cooper charles-cooper enabled auto-merge (squash) March 17, 2025 11:44
@charles-cooper charles-cooper merged commit 694f001 into vyperlang:master Mar 17, 2025
159 checks passed
@tserg tserg deleted the fix/address_members_as_struct branch March 18, 2025 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release - must release blocker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: TypeCheckFailure when using address and self members as struct field name

4 participants