Skip to content

Incorrectly finds private variables and procedures #485

Open
@cmbant

Description

@cmbant

Private variables and procedures are being name-clashed in places where the module is used. E.g. in this example it finds "error" and "x" mask variable in parent scope (but both are actually private and hence not in scope).

    module Utils
    implicit none
    private

    integer x

    Type :: TFileStream
    contains
    procedure :: Error
    end type

    public TFileStream
    contains

    subroutine Error(this)
    class(TFileStream) :: this
    end subroutine
    end module

    program name
    use Utils

    contains

    subroutine test
    integer error
    integer x

    end subroutine

    end program name

This issue happens a lot, e.g. in the forutils library (https://github.com/cmbant/forutils/)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions