From e19083c2cb5e53893fd84c2448d47f0b9cf928e3 Mon Sep 17 00:00:00 2001 From: Ahmad Nawab Date: Mon, 20 Nov 2023 22:31:44 +0100 Subject: [PATCH] Minor fixes suggested in PR --- loki/backend/fgen.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/loki/backend/fgen.py b/loki/backend/fgen.py index 635119131..2576c8ca3 100644 --- a/loki/backend/fgen.py +++ b/loki/backend/fgen.py @@ -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']