Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29297 Discussions

Parameterized Derived Type: error #6197: An assignment of different structure types is invalid

FortranFan
Honored Contributor III
838 Views

The code below appears ok, but compiler throws an unexpected error #6197: An assignment of different structure types is invalid:

module m

   implicit none

   type, abstract :: a(k)
      integer, kind :: k
   end type

   type, extends(a) :: e
   end type
   
   type :: c
      type( e(k=42) ) :: foo = e(k=42)()
   end type

end module
Compiling with Intel(R) Visual Fortran Compiler 17.0.0.109 [Intel(R) 64]...
m.f90
m.f90(13): error #6197: An assignment of different structure types is invalid.   [FOO]
ifort: error #10298: problem during post processing of parallel object compilation
compilation aborted for m.f90 (code 1)

 

0 Kudos
1 Reply
Xiaoping_D_Intel
Employee
838 Views

I have reproduced the error and escalated it to developers. The track ID is DPD200415349.

 

Thanks,

Xiaoping Duan

Intel Customer Support

0 Kudos
Reply