fortran-language-server icon indicating copy to clipboard operation
fortran-language-server copied to clipboard

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

Open kernie opened this issue 5 years ago • 1 comments

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

kernie avatar Sep 03 '19 17:09 kernie

This can be closed (changelog for 1.11.0).

mystery-e204 avatar Jan 11 '21 10:01 mystery-e204