fortls icon indicating copy to clipboard operation
fortls copied to clipboard

`character(len=*)` underlined as an error when len is a declared variable elsewhere.

Open blaylockbk opened this issue 2 years ago • 1 comments

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.

image

The "len" statemen inside a character declaration should never refer to a declared variable named len, right? This may be a bug in fortls.

blaylockbk avatar Jul 15 '22 20:07 blaylockbk

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

gnikit avatar Aug 31 '22 11:08 gnikit