Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Valued Contributor III
11 Views

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.   

 

0 Kudos
1 Reply
Highlighted
Employee
11 Views

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 Kudos