Skip to content

Commit

Permalink
rollback module.at() method
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Nov 20, 2023
1 parent 4a8cc12 commit 0a786f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/unit/cli/vyper_compile/test_compile_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def foo() -> FooStruct:
@external
def bar(a: address) -> FooStruct:
return {}.at(a).bar()
return {}(a).bar()
"""

BAR_CODE = """
Expand Down
11 changes: 7 additions & 4 deletions vyper/semantics/types/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ def __init__(self, module: vy_ast.Module, name: Optional[str] = None):
# for function collisions
interface_t = self.interface

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable interface_t is not used.

# module.at(<address>)
at = MemberFunctionT(self, "at", [AddressT()], interface_t, is_modifying=False)

members = {"at": at}
members = {}

for f in self.functions:
members[f.name] = f._metadata["type"]
Expand All @@ -32,6 +29,12 @@ def __init__(self, module: vy_ast.Module, name: Optional[str] = None):
def get_type_member(self, key: str, node: vy_ast.VyperNode) -> "VyperType":
return self._helper.get_member(key, node)

def _ctor_call_return(self, node):
return self.interface._ctor_call_return(node)

def _ctor_arg_types(self, node):
return self.interface._ctor_arg_types(node)

# this is a property, because the function set changes after AST expansion
@property
def functions(self):
Expand Down

0 comments on commit 0a786f7

Please sign in to comment.