Skip to content

Commit

Permalink
Minor fixes suggested in PR
Browse files Browse the repository at this point in the history
  • Loading branch information
awnawab committed Nov 21, 2023
1 parent c1881b8 commit e19083c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions loki/backend/fgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,13 +332,13 @@ def visit_VariableDeclaration(self, o, **kwargs):
_var_types = [t.dtype.return_type.dtype if isinstance(t.dtype, ProcedureType) else t.dtype for t in types]
_procedure_types = [t for t in types if isinstance(t.dtype, ProcedureType)]

if len(_procedure_types) > 0:
if _procedure_types:
# Statement functions are the only symbol with ProcedureType that should appear
# in a VariableDeclaration as all other forms of procedure declarations (bindings,
# pointers, EXTERNAL statements) are handled by ProcedureDeclaration.
# However, the fact that statement function declarations can appear mixed with actual
# variable declarations forbids this in this case.
assert _procedure_types[0].is_stmt_func
assert all(t.is_stmt_func for t in _procedure_types)
# TODO: We can't fully compare statement functions, yet but we can make at least sure
# other declared attributes are compatible and that all have the same return type
ignore += ['dtype']
Expand Down

0 comments on commit e19083c

Please sign in to comment.