Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28455 讨论

Parameterized derived types: another unexpected compiler error

FortranFan
名誉分销商 II
262 次查看
module m

   implicit none

   type t(n)
      integer, len :: n
      integer :: i(n)
   end type

contains

   function foo() result(r)

      type(t(n=:)), allocatable :: r  !.. Compiler accepts this

   end function foo

   function bar( n ) result(r)

      integer, intent(in) :: n
      type(t(n=:)), allocatable :: r  !.. Compiler accepts this

   end function bar

   function foobar( a ) result(r)

      type(t(n=*)), intent(in) :: a
      type(t(n=:)), allocatable :: r   !.. Here the compiler issues error #8541

   end function foobar

end module m
Compiling with Intel(R) Visual Fortran Compiler 16.0 [Intel(R) 64]...
m.f90
m.f90(28): error #8541: Not yet implemented: type containing ALLOCATABLE field of same type.  Use POINTER instead.   

 

0 项奖励
1 回复
Kevin_D_Intel
员工
262 次查看

Thank you for reporting this and for the nice reproducer. I will report this to Development and update the internal id below.

(Internal tracking id: TBD)

0 项奖励
回复