module m implicit none contains subroutine double(i) integer :: i i = 2*i end subroutine double function bar() result(res) procedure(double), pointer :: res res => double end function bar subroutine foo(i) integer :: i procedure(bar) :: var procedure(double), pointer :: proc associate (var => bar()) proc => var end associate call proc(i) end subroutine foo end module m program test use m implicit none (type, external) integer :: i i = 50 call foo(i) if (i /= 50*2) stop 1 end program test