Skip to content

Commit

Permalink
fix #1273
Browse files Browse the repository at this point in the history
  • Loading branch information
ixje committed Aug 23, 2024
1 parent 58d33fd commit 2419de3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions boa3/internal/analyser/moduleanalyser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions boa3/internal/compiler/codegenerator/codegeneratorvisitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 2419de3

Please sign in to comment.