https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92065
--- Comment #12 from Dominique d'Humieres <dominiq at lps dot ens.fr> --- The following test compiles (swapping fun1 and fun2): module buggy implicit none type :: bar integer :: x end type bar type :: foo integer :: n contains procedure :: fun1 procedure :: fun2 end type foo contains integer function fun1(this, a) implicit none class(foo) :: this class(bar), intent(in) :: a(this%n) fun1 = a(1)%x end function fun1 subroutine fun2(this, a) implicit none class(foo) :: this class(bar), intent(in) :: a(this%n) end subroutine fun2 end module buggy