Skip to content

Commit

Permalink
Store source for helper var declaration representing return type
Browse files Browse the repository at this point in the history
  • Loading branch information
reuterbal committed Mar 24, 2023
1 parent c512f8e commit cd13933
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion loki/frontend/fparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1778,7 +1778,8 @@ def visit_Subroutine_Subprogram(self, o, **kwargs):
if return_type is not None:
routine.symbol_attrs[routine.name] = return_type
return_var = sym.Variable(name=routine.name, scope=routine)
return_var_decl = ir.VariableDeclaration(symbols=(return_var,))
decl_source = self.get_source(subroutine_stmt, source=None)
return_var_decl = ir.VariableDeclaration(symbols=(return_var,), source=decl_source)

decls = FindNodes((ir.VariableDeclaration, ir.ProcedureDeclaration)).visit(spec)
if not decls:
Expand Down

0 comments on commit cd13933

Please sign in to comment.