From 2419de33d6e17f7becaf868f46e3eb042be1bffe Mon Sep 17 00:00:00 2001 From: Erik van den Brink Date: Fri, 23 Aug 2024 14:09:16 +0200 Subject: [PATCH] fix #1273 --- boa3/internal/analyser/moduleanalyser.py | 3 +++ boa3/internal/compiler/codegenerator/codegeneratorvisitor.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/boa3/internal/analyser/moduleanalyser.py b/boa3/internal/analyser/moduleanalyser.py index 1c28c3e26..a00ca888d 100644 --- a/boa3/internal/analyser/moduleanalyser.py +++ b/boa3/internal/analyser/moduleanalyser.py @@ -18,6 +18,7 @@ from boa3.internal.model.builtin.compile_time.neometadatatype import MetadataTypeSingleton from boa3.internal.model.builtin.decorator import ContractDecorator from boa3.internal.model.builtin.decorator.builtindecorator import IBuiltinDecorator +from boa3.internal.model.builtin.interop.runtime import ScriptContainerProperty from boa3.internal.model.builtin.method.builtinmethod import IBuiltinMethod from boa3.internal.model.callable import Callable from boa3.internal.model.decorator import IDecorator @@ -1432,6 +1433,8 @@ def visit_Attribute(self, attribute: ast.Attribute) -> ISymbol | str: if isinstance(value, Variable): value = value.type + elif isinstance(value, ScriptContainerProperty): + value = value.type attribute_symbol = None if hasattr(value, 'symbols') and attribute.attr in value.symbols: diff --git a/boa3/internal/compiler/codegenerator/codegeneratorvisitor.py b/boa3/internal/compiler/codegenerator/codegeneratorvisitor.py index 1f3b4287d..f6eec5457 100644 --- a/boa3/internal/compiler/codegenerator/codegeneratorvisitor.py +++ b/boa3/internal/compiler/codegenerator/codegeneratorvisitor.py @@ -126,6 +126,9 @@ def visit_to_generate(self, node) -> GeneratorData: result = self.visit(node) if not result.already_generated and result.symbol_id is not None: + if isinstance(node, ast.Attribute): + self.visit_to_generate(node.value) + if self.is_exception_name(result.symbol_id): self.generator.convert_new_exception() else: