社区
取消
显示结果 
搜索替代 
您的意思是: 
Highlighted
重要分销商 III
13 次查看

Parameterized derived types: another unexpected compiler error

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.   

 

标记 (1)
0 项奖励
1 回复
Highlighted
13 次查看

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 项奖励