module types implicit none type :: test_type(n) integer, len :: n ! Length of array of independent variables integer :: t(n) end type test_type interface assignment(=) module procedure assign_from_self end interface assignment(=) contains subroutine assign_from_self(this, other) type(test_type(n=*)) , intent(out) :: this type(test_type(n=this%n)), intent(in) :: other this%t = other%t end subroutine assign_from_self end module types program ifort_bug use types, only : test_type, assign_from_self !use types implicit none call test_subroutine(3) contains subroutine test_subroutine(n) integer, intent(in) :: n type(test_type(n=n)) :: x type(test_type(n=n)) :: y x%t = [42,73,37] y = x call write_types(x) call write_types(y) end subroutine test_subroutine subroutine write_types(x) type(test_type(n=*)), intent(in) :: x integer :: i write(*,'(*(I8))') x%t(1:x%n) end subroutine write_types end program ifort_bug