fortls
fortls copied to clipboard
`character(len=*)` underlined as an error when len is a declared variable elsewhere.
Originally Discussed Here: https://github.com/fortran-lang/vscode-fortran-support/discussions/574
Describe the bug
I have a subroutine in a large code base. I get an underlined error indicator for character(len=10)
when there happens to be a variable len
declared elsewhere. When I hover over the error underlining, the message says Object "len" not found in scope
and then gives the name of the file where the variable len
is declared as an object.
The "len" statemen inside a character declaration should never refer to a declared variable named len, right? This may be a bug in fortls.
This is the MWE to replicate it
module foo
character(len=100), parameter :: TEST = "4.10.4"
end module foo
program main
use foo
integer :: len
end program main