hansec / fortran-language-server

Fortran Language Server for the Language Server Protocol
MIT License
295 stars 57 forks source link

Using constructor function as derived type generic interface warns about derived type variable was declared twice #138

Open kernie opened 5 years ago

kernie commented 5 years ago

Hi,

having something like:

module shape_mod

    private    ! hide the type-bound procedure implementation procedures
    public :: shape ! allow access to shape

    type shape
        private               ! hide the underlying details
        integer :: color
        logical :: filled
        integer :: x
        integer :: y
    end type shape

    interface shape
        procedure constructor       ! add constructor to shape generic interface
    end interface

    contains

    function constructor(color, filled, x, y)
            type(shape) :: constructor
            integer :: color
            logical :: filled
            integer :: x
            integer :: y
            ! do something as constructor
        end function constructor

    end module shape_mod

issues a warning in visual code editor: "Variable "shape" declared twice in scope"

Maybe related to Issue #18

mystery-e204 commented 3 years ago

This can be closed (changelog for 1.11.0).