diff --git a/tests/functional/syntax/test_interfaces.py b/tests/functional/syntax/test_interfaces.py index 20813c48d1..86ea4bcfd0 100644 --- a/tests/functional/syntax/test_interfaces.py +++ b/tests/functional/syntax/test_interfaces.py @@ -381,13 +381,22 @@ def test_interfaces_success(good_code): def test_imports_and_implements_within_interface(make_input_bundle): - interface_code = """ + ibar_code = """ @external def foobar(): ... """ + ifoo_code = """ +import bar - input_bundle = make_input_bundle({"foo.vyi": interface_code}) +implements: bar + +@external +def foobar(): + ... +""" + + input_bundle = make_input_bundle({"foo.vyi": ifoo_code, "bar.vyi": ibar_code}) code = """ import foo as Foo diff --git a/vyper/semantics/analysis/imports.py b/vyper/semantics/analysis/imports.py index be1f2da312..3268f12e94 100644 --- a/vyper/semantics/analysis/imports.py +++ b/vyper/semantics/analysis/imports.py @@ -194,6 +194,7 @@ def _load_import_helper( file = self.input_bundle.load_file(path.with_suffix(".vyi")) assert isinstance(file, FileInput) # mypy hint module_ast = self._ast_from_file(file) + self.resolve_imports(module_ast) # language does not yet allow recursion for vyi files # self.resolve_imports(module_ast)