From ab1a2e33192af200a5652f7c82fc7bbb0437b82f Mon Sep 17 00:00:00 2001 From: cyberthirst Date: Fri, 5 Apr 2024 09:42:27 +0200 Subject: [PATCH] fix hint for initializer w no references --- vyper/semantics/analysis/module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vyper/semantics/analysis/module.py b/vyper/semantics/analysis/module.py index c866146382..a67e64adf6 100644 --- a/vyper/semantics/analysis/module.py +++ b/vyper/semantics/analysis/module.py @@ -507,7 +507,7 @@ def visit_InitializesDecl(self, node): if rhs is None: hint = f"try importing {item.alias} first" - elif isinstance(module_ref, vy_ast.NamedExpr): + elif not isinstance(module_ref.parent, vy_ast.Subscript): hint = f"did you mean {module_ref.id}[{lhs} := {rhs}]?" else: hint = f"add `{lhs} := {rhs}` to its initializer list"