Intrinsic Assignment and Polymorphism in Fortran 2003
I tried adding a procedure to this module , written by @VladimirF , that implements a generic linked list in Fortran 2003. I wanted to be able to output the contents of the list as an array for convenience, so I added the following procedure to a lists module in a file called lists.f90 : subroutine list_as_array(self, arrayOut) class(list),intent(inout) :: self class(*),dimension(1:self%length),intent(out) :: arrayOut integer :: i type(list_node), pointer :: nodeIter nodeIter = self%first do i = 1,self%length arrayOut(i) = nodeIter%item ! <---ERROR here if (i<self%length) then nodeIter =