Skip to content

Commit

Permalink
Transformation: Fix for internal routine extraction with literal kinds
Browse files Browse the repository at this point in the history
  • Loading branch information
mlange05 committed Oct 7, 2024
1 parent cef6cf1 commit 046af65
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion loki/transformations/extract/internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def extract_internal_procedure(procedure, name):
# Produce kinds appearing in `vars_to_resolve` or in `inner.spec` that need to be resolved
# from imports of `procedure`.
kind_imports_to_add = tuple(v.type.kind for v in vars_to_resolve + inner_spec_vars \
if v.type.kind and v.type.kind.scope is procedure)
if v.type.kind and hasattr(v.type.kind, 'scope') and v.type.kind.scope is procedure)

# Produce all imports to add.
# Here the imports are also tidied to only import what is strictly necessary, and with single
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def test_extract_internal_procedures_kind_resolution(frontend):
contains
subroutine inner()
integer(kind = jpim) :: y
integer :: z
integer(kind=8) :: z
z = y
end subroutine inner
end subroutine outer
Expand Down

0 comments on commit 046af65

Please sign in to comment.