diff --git a/loki/expression/mappers.py b/loki/expression/mappers.py index 0849ecff9..a3aff74c6 100644 --- a/loki/expression/mappers.py +++ b/loki/expression/mappers.py @@ -597,6 +597,8 @@ def map_variable_symbol(self, expr, *args, **kwargs): if expr.scope is None: if parent is expr.parent and not is_type_changed: return expr + elif not is_type_changed: + return expr.clone(parent=parent) return expr.clone(parent=parent, type=new_type) if parent is expr.parent: