Consider the following code:
module m implicit none abstract interface function I_f() result( j ) integer :: j end function I_f end interface type :: t procedure(I_f), nopass, pointer :: m_f => null() contains procedure, pass(this) :: f => get_f end type t contains function get_f( this ) result( f_ptr ) class(t), intent(in) :: this procedure(I_f), pointer :: f_ptr f_ptr => this%m_f return end function get_f end module m
program p use m, only : t, I_f implicit none procedure(I_f), pointer :: f_ptr type(t) :: foo f_ptr => foo%f() stop end program p
Compiler 17 processes the module code without any complaints, but gives an unexpected error with the main program:
1>Compiling with Intel(R) Visual Fortran Compiler 17.0.0.109 [IA-32]... 1>m.f90 1>p.f90 1>p.f90(10): error #8191: The procedure target must be a procedure or a procedure pointer. 1>ifort: error #10298: problem during post processing of parallel object compilation