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

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

Closed
tserg opened this issue Jul 19, 2023 · 3 comments · May be fixed by #3527
Closed

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

tserg opened this issue Jul 19, 2023 · 3 comments · May be fixed by #3527

Comments

@tserg
Copy link
Collaborator

tserg commented Jul 19, 2023

Version Information

  • vyper Version (output of vyper --version): 9e3b9a2
  • OS: linux
  • Python Version (output of python --version): 3.10.4

What's your issue about?

Accessing the field of an enum named after an address or self member (balance, codesize, is_contract, codehash or code) results in a TypeCheckFailure.

This contract fails to compile: TypeCheckFailure: Attribute node did not produce IR

struct User:
    balance: uint256

@external
def foo():
    a: User = User({balance: 12})
    b: uint256 = a.balance

h/t @trocher

How can it be fixed?

Fill this in if you know how to fix it.

@trocher
Copy link
Contributor

trocher commented Apr 11, 2024

might be fixed in 0.4.0rc1 given that #3939 is @charles-cooper, the POC above compile fine now.

@charles-cooper
Copy link
Member

todo: bisect to find the fixing commit

@charles-cooper
Copy link
Member

bisect showed 7bdebbf as the fixing commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants