https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65548
--- Comment #25 from Jürgen Reuter <juergen.reuter at desy dot de> --- Example 1: module foo type :: t integer :: n real, dimension(:,:), allocatable :: val contains procedure :: make => t_make generic :: get_int => get_int_array, get_int_element procedure :: get_int_array => t_get_int_array procedure :: get_int_element => t_get_int_element end type t contains subroutine t_make (this) class(t), intent(inout) :: this real, dimension(:), allocatable :: int allocate (int (0:this%n-1), source=this%get_int()) end subroutine t_make pure function t_get_int_array (this) result (array) class(t), intent(in) :: this real, dimension(this%n) :: array array = this%val (0:this%n-1, 4) end function t_get_int_array pure function t_get_int_element (this, set) result (element) class(t), intent(in) :: this integer, intent(in) :: set real :: element element = this%val (set, 4) end function t_get_int_element end module foo