Interfacing bounded procedure

Hi

I have an issue that I do not understand about interfacing bounded procedure. Example of what I try to do :

type set
  ....
  contains 
  procedure, pass(this) : push => push_one, push_set
end type set

the corresponding subroutine definition

subroutine push_one(this,val)
  class(set),intent(inout) :: this
  real, intent(in) :: val
  .....
end subroutine push_one

subroutine push_set(this,valSet)
  class(set),intent(inout) :: this
  type(set), intent(in) :: valSet
  ....
end subroutine push_set

When calling push_one through push in an another module, the compiler does not complain. But when changing the order in the type set definition :

procedure, pass(this) : push => push_set, push_one

the compiler complains about passing a real to the set valSet

My conclusion : there must be something I am doing wrong about interfacing bounded subroutine, although what I am doing seems to be coherent
with https://fortran-lang.discourse.group/t/drawback-of-type-bound-procedures-vs-interfaces/2138
I hope not being redundant with other threads…

Thank you in advance for your help
PS: compiler : gfortran-10 OS : ubuntu 22.04

I think that the syntax should rather be:

type set
  ....
contains 
  procedure, pass(this) :: push_one, push_set
  generic :: push => push_one, push_set
end type set

In your syntax you are binding a procedure push that points to push_one, and separately a procedure push_set. That is, push is not a generic name, just an alias.

oops !!!
thanx pierU, looks like I need to practice fortran 90 a bit more. I should have think about it when inverting … I am not still used to the generic keyword although I practiced it a bit when introducing myself to fortran-90. Getting older do not help memorizing :frowning: