Skip to content

Commit

Permalink
wrap all interfaces with TYPE_T
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Apr 16, 2024
1 parent 9a50b83 commit a32a989
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions vyper/semantics/analysis/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ def visit_ExportsDecl(self, node):
elif isinstance(info.typ, ContractFunctionT):
# regular function
funcs = [info.typ]
elif isinstance(info.typ, InterfaceT) or is_type_t(info.typ, InterfaceT):
elif is_type_t(info.typ, InterfaceT):
if not isinstance(item, vy_ast.Attribute):
raise StructureException(
"invalid export",
Expand All @@ -561,9 +561,7 @@ def visit_ExportsDecl(self, node):
if module_info is None:
raise StructureException("not a valid module!", item.value)

ityp = info.typ
if isinstance(info.typ, TYPE_T):
ityp = ityp.typedef
ityp = info.typ.typedef

if ityp not in module_info.typ.implemented_interfaces:
iface_str = item.node_source_code
Expand Down Expand Up @@ -788,6 +786,9 @@ def _add_import(
node._metadata["import_info"] = ImportInfo(
module_info, alias, qualified_module_name, compiler_input, node
)
# consider wrapping Modules in TYPE_T as well
if isinstance(module_info, InterfaceT):
module_info = TYPE_T(module_info)
self.namespace[alias] = module_info

# load an InterfaceT or ModuleInfo from an import.
Expand Down

0 comments on commit a32a989

Please sign in to comment.