Nvfortran rejects valid code

nvfortran 24.3 rejects the code below with the error message
NVFORTRAN-S-0034-Syntax error at or near POS (omega_birdtracks.f90: 58)
0 inform, 0 warnings, 1 severes, 0 fatal for epsilon3_to_string
We believe, however, that this is valid code:

module omega_birdtracks
  implicit none
  private
  integer, parameter :: IO_BUFFER_SIZE = 1000
  public :: epsilon3
  type :: epsilon3
     integer, dimension(3) :: j
  contains
     procedure :: to_string => epsilon3_to_string
  end type epsilon3
contains
  elemental function integer_width (i) result (w)
    integer, intent(in) :: i
    integer :: w
    character(IO_BUFFER_SIZE) :: buffer
    write (unit = buffer, fmt = "(I0)") i
    w = len_trim (buffer)
  end function integer_width
  pure function max_integer_width (a) result (w)
    integer, dimension(:), intent(in) :: a
    integer :: w
    w = max (integer_width (minval (a)), integer_width (maxval (a)))
  end function max_integer_width
  pure function integer_array_format (a, prefix, postfix) result (fmt)
    integer, dimension(:), intent(in) :: a
    character(*), intent(in), optional :: prefix, postfix
    character(:), allocatable :: fmt
    character(:), allocatable :: pre, post
    character(IO_BUFFER_SIZE) :: buffer
    integer :: w
    w = max_integer_width (a)
    if (present (prefix)) then
      pre = prefix
    else
      pre = "["
    endif
    if (present (postfix)) then
      post = postfix
    else
      post = "]"
    endif
    select case (size (a))
    case (0)
       fmt = "'" // pre // post // "'"
    case (1)
       write (buffer, "(3A,I0,3A)") "'", pre, "', I", w, ", '", post, "'"
       fmt = trim (buffer)
    case default
       write (buffer, "(3A,3(I0,A),2A)") "'", pre, "',", size(a) - 1, "(I", w, ", ','), I", w, ", '", post, "'"
       fmt = trim (buffer)
    end select
  end function integer_array_format
  pure function epsilon3_to_string (e) result (s)
    class(epsilon3), intent(in) :: e
    character(:), allocatable :: s
    character(IO_BUFFER_SIZE) :: buffer
    integer :: iostat
    write (unit = buffer, fmt = &
               "('eps'," // integer_array_format (e%j, prefix = "(", postfix = ")") // ")",  &
           iostat = iostat) e%j
  end function epsilon3_to_string
end module omega_birdtracks