You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
module mod_a
integer, parameter:: q_a =4
end module
module mod_b
use mod_a
integer, parameter:: q_b =8
end module
program test
use mod_b, only: q_b
use mod_a
real(q_a) :: r_a
real(q_b) :: r_b
end program test
It compiles and runs fine but fortls states that q_a on line 14 cannot be found in the scope. The problem disappears if you swap the order of the use directives in the main program.
My guess is that because of the use mod_a on line 6, fortls does not parse mod_a a second time in the main program. However, since only q_b was included from mod_b, q_a never gets properly included.
The text was updated successfully, but these errors were encountered:
@gnikit Thanks for bringing this to my attention. I was unaware of your fork since I haven't been coding in Fortran for a while. I will check it out and also thanks for the fix.
I have a situation like this:
It compiles and runs fine but fortls states that
q_a
on line 14 cannot be found in the scope. The problem disappears if you swap the order of the use directives in the main program.My guess is that because of the
use mod_a
on line 6, fortls does not parsemod_a
a second time in the main program. However, since onlyq_b
was included frommod_b
,q_a
never gets properly included.The text was updated successfully, but these errors were encountered: