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