title: Generic type-bound procedures with procedure arguments
body: <p>I am trying to write a generic type-bound procedure that takes different callback functions as parameters. When compiling following code (with ifort 12.1.3) I get the warning below:</p>
  
  <pre><code>module test
  
  type :: a_type
    contains
    procedure :: t_s =&gt; at_s
    procedure :: t_d =&gt; at_d
    generic :: t =&gt; t_s,t_d
  end type a_type
  
  abstract interface
    integer function cb_s(arg)
    real(4) :: arg
    end function cb_s
  
    integer function cb_d(arg)
    real(8) :: arg
    end function cb_d
  end interface
  
  contains
  
  subroutine at_s(this,cb)
    class(a_type) :: this
    procedure(cb_s) :: cb 
  end subroutine
  
  subroutine at_d(this,cb)
    class(a_type) :: this
    procedure(cb_d) :: cb 
  end subroutine
  
  end module test
  </code></pre>
  
  <p>The warning:</p>
  
  <pre><code>compileme.f(27): warning #8449: The type/rank/keyword signature for this specific
  procedure matches another specific procedure that shares the same generic
  binding name.   [AT_D]
  </code></pre>
  
  <p>It seems like the compiler is not differentiating between different function interfaces when used as procedure arguments...</p>
  
  <p>My question is: Why aren't those types checked and what is the correct, clean way to write generic type-bound procedures with procedures or procedure pointers as arguments?</p>
  
  <p><strong>Possible solution</strong></p>
  
  <p>As Vladimir F pointed out, only the callback function's return arguments are type checked. In my case it is OK to then just slightly change the functions' interfaces:</p>
  
  <pre><code>abstract interface
    real(4) function cb_s(arg)
    real(4) :: arg
    end function cb_s
  
    real(8) function cb_d(arg)
    real(8) :: arg
    end function cb_d
  end interface
  </code></pre>