Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
33 Views

yet another bug(?) in parameterized derived types

Hi all

I think this code should compile:

Module modparadt
  Type, public :: xx(k)
    Integer, kind :: k
    integer(k), allocatable :: v(:)
  End type xx
End Module modparadt
Program Test
  use modparadt
  Type(xx(8)), pointer :: yy=>null()
end Program Test

but when using ifort 17.07 and ifort 18.03 it stops with

tmp.f90(9): error #6197: An assignment of different structure types is invalid.   [YY]
  Type(xx(8)), pointer :: yy=>null()

any comments. If this is a bug I'll launch a ticket pointing to this theard.

cheers

0 Kudos
2 Replies
Highlighted
Valued Contributor I
33 Views

Indeed, this compiles and runs with PGI 18.5, gfortran 9.0.0 (experimental) and nagfor 6.2 without any problems. 

0 Kudos
Highlighted
Honored Contributor I
33 Views

I too think it is a bug in Intel Fortran.  And it persists in 19.0 Beta Update 1 as well.

For whatever it's worth, the following change where the initialization of the object in the declaration is replaced with a separate pointer assignment instruction. Intel Fortran compiles the code ok:

  type(xx(k=8)), pointer :: yy
  yy => null()

 

0 Kudos