title: Type-bound procedure gives error about non-polymorphic passed-object dummy argument
body: <p>I'm trying to compile the Fortran module below (using gfortran 7.2.0). The point is to define a derived type that in turn contains two instances of the derived type <code>bspline_3d</code> from the bspline-fortran library (<a href="https://github.com/jacobwilliams/bspline-fortran" rel="noreferrer">https://github.com/jacobwilliams/bspline-fortran</a>). I then want to define a type-bound procedure that will in turn call the type-bound <code>evaluate</code> procedure of both of those types, and return the result as an array with two elements.</p>
  
  <p>When I try to compile the module below, I get an error message saying</p>
  
  <pre><code>     procedure  :: evaluate =&gt; evaluate_2d
               1
  Error: Non-polymorphic passed-object dummy argument of 'evaluate_2d' at (1)
  </code></pre>
  
  <p>I understand absolutely nothing of the error message. </p>
  
  <p>I managed to compile the simple example program found here: <a href="http://fortranwiki.org/fortran/show/Object-oriented+programming" rel="noreferrer">http://fortranwiki.org/fortran/show/Object-oriented+programming</a> and as far as I can tell, the only difference is that in my case, the "passed-object" (<code>this</code>) does itself have derived-type member variables (<code>type(bspline_3d) :: fvx, fvy</code>), which in turn probably contain all sorts of stuff.</p>
  
  <pre><code>module interpolator_module
  
  use bspline_module
  use parameters, only: WP
  
  implicit none
  
  private
  public :: interpolator
  
  type :: interpolator
      type(bspline_3d) :: fvx, fvy
      contains
          private
          procedure  :: evaluate =&gt; evaluate_2d
  end type interpolator
  
  contains
      function evaluate_2d(this, X, t) result(V)
          implicit none
          ! inputs
          type(interpolator),     intent(inout) :: this
          real(WP), dimension(2), intent(in)    :: X
          real(WP),               intent(in)    :: t
          ! output
          real(WP), dimension(2)                :: V
          ! local variables
          integer                               :: iflag
          integer, parameter                    :: d = 0
  
          call this%fvx%evaluate(X(1), X(2), t, d, d, d, V(1), iflag)
          call this%fvy%evaluate(X(1), X(2), t, d, d, d, V(2), iflag)
      end function
  end module interpolator_module
  </code></pre>