The types in modules A and B are different as per F95 4.4.2 (same name, same
components but not SEQUENCE). The error "Can't convert TYPE(ta) to TYPE(ta)" is
not very helpful in this case.

$> cat sametype.f90
MODULE a
  TYPE :: ta
    INTEGER :: i
  END TYPE
END MODULE

MODULE b
  TYPE :: ta
    INTEGER :: i
  END TYPE
CONTAINS
  FUNCTION getA()
     TYPE(ta) :: getA
     getA%i = 42
  END FUNCTION
END MODULE

  USE a, ONLY: ta
  USE b, ONLY: getA

  TYPE(ta) :: t
  t = getA()
END

$> sametype.f90:25.6:

  t = getA()
      1
Error: Can't convert TYPE(ta) to TYPE(ta) at (1)

$> gfortran-svn --version
GNU Fortran (GCC) 4.4.0 20081223 (experimental)


-- 
           Summary: error message when converting between different derived
                    types with same name
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dfranke at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38619

Reply via email to