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 回复