When I compile the modules listed below I get the following error message: e.f90:51.30: use poly_Personnel_class 1 Error: Name 'new' at (1) is an ambiguous reference to 'new' from module 'student_class'
Compaq Fortran, Lahey Fortran, and g95 do not produce an error. module Personnel_class implicit none private :: init_Personnel interface new module procedure init_Personnel end interface contains subroutine init_Personnel(this) integer, intent (in) :: this end subroutine init_Personnel end module Personnel_class module Student_class use Personnel_class implicit none private :: init_Student type Student private integer :: personnel end type Student interface new module procedure init_Student end interface contains subroutine init_Student(this) type (Student), intent (in) :: this call new(this%personnel) end subroutine init_Student end module Student_class module Teacher_class use Personnel_class implicit none private :: init_Teacher type Teacher private integer :: personnel end type Teacher interface new module procedure init_Teacher end interface contains subroutine init_Teacher(this) type (Teacher), intent (in) :: this call new(this%personnel) end subroutine init_Teacher end module Teacher_class module poly_Personnel_class use Student_class use Teacher_class end module poly_Personnel_class module Database_class use poly_Personnel_class end module Database_class -- Summary: Spurious error: Name 'x' at (1) is an ambiguous reference to 'x' from module 'y' Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: michael dot a dot richmond at nasa dot gov http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32526