Skip to content

Commit

Permalink
Fix missing symbol error when using scalar struct members in loop range
Browse files Browse the repository at this point in the history
  • Loading branch information
phschaad committed Jan 8, 2025
1 parent 7ba2777 commit 455bd5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dace/frontend/python/newast.py
Original file line number Diff line number Diff line change
Expand Up @@ -2350,7 +2350,7 @@ def visit_For(self, node: ast.For):
if symbolic.issymbolic(atom, self.sdfg.constants):
astr = str(atom)
# Check for undefined variables
if astr not in self.defined:
if astr not in self.defined and not ('.' in astr and astr in self.sdfg.arrays):
raise DaceSyntaxError(self, node, 'Undefined variable "%s"' % atom)
# Add to global SDFG symbols if not a scalar
if (astr not in self.sdfg.symbols and not (astr in self.variables or astr in self.sdfg.arrays)):
Expand Down

0 comments on commit 455bd5b

Please sign in to comment.