Skip to content

Commit

Permalink
Revert "remove else branch"
Browse files Browse the repository at this point in the history
This reverts commit 9de0941.
  • Loading branch information
tserg committed Dec 30, 2024
1 parent c2f6724 commit 48fed75
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions vyper/codegen/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,17 +321,17 @@ def parse_Attribute(self):
"chain.id is unavailable prior to istanbul ruleset", self.expr
)
return IRnode.from_list(["chainid"], typ=UINT256_T)

# Other variables
sub = Expr(self.expr.value, self.context).ir_node
# contract type
if isinstance(sub.typ, InterfaceT):
# MyInterface.address
assert self.expr.attr == "address"
sub.typ = typ
return sub
if isinstance(sub.typ, StructT) and self.expr.attr in sub.typ.member_types:
return get_element_ptr(sub, self.expr.attr)
else:
sub = Expr(self.expr.value, self.context).ir_node
# contract type
if isinstance(sub.typ, InterfaceT):
# MyInterface.address
assert self.expr.attr == "address"
sub.typ = typ
return sub
if isinstance(sub.typ, StructT) and self.expr.attr in sub.typ.member_types:
return get_element_ptr(sub, self.expr.attr)

def parse_Subscript(self):
sub = Expr(self.expr.value, self.context).ir_node
Expand Down

0 comments on commit 48fed75

Please sign in to comment.