Skip to content

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

@tserg

Description

@tserg

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions