fails to compile the valid code

Uttam Pawar uttamp@us.ibm.com
Wed Nov 23 00:50:00 GMT 2005


Hi,

gfortran fails to compile the valid code (which has structure
constructor and generic name)

$ cat test.f90
       module mytype_module
       type mytype
          private
          complex value
          logical exact
       end type
          interface mytype
             module procedure int_to_mytype
          end interface
          contains
           type(mytype) function int_to_mytype(i)
              integer, intent(in) :: i
              int_to_mytype%value = i
              int_to_mytype%exact = .TRUE.
           end function
       end module mytype_module

$ gfortran test.f90
 In file t44.f90:7

          interface mytype
                         1
Error: DERIVED attribute conflicts with PROCEDURE attribute at (1)
 In file t44.f90:8

             module procedure int_to_mytype
                             1
Error: MODULE PROCEDURE at (1) must be in a generic module interface
 In file t44.f90:9

          end interface
            1
Error: Expecting END MODULE statement at (1)

This code compiles fine with xlf95.

Thanks in advance.

- Uttam



More information about the Fortran mailing list