Hi, everyone. The following code puzzles me:
module test type :: tp private integer :: i contains private generic, public :: ge => sub1, & sub2 procedure, pass :: sub1 procedure, pass :: sub2 end type tp contains subroutine sub1(this, s) class(ab), intent(in) :: this class(*), intent(in) :: s end subroutine sub1 subroutine sub2(this, s) class(ab), intent(in) :: this integer, intent(in) :: s end subroutine sub2 end module test
And the compiler says:
Ambiguous generic interface GE: previously declared specific procedure SUB1 is not distinguishable from this declaration. [SUB2]
Is it a problem to distinguish INTEGER from unlimited polymorphic ?
Perhaps the other way around: an unlimited polymorphic variable can have any type, so indeed it can not be distinguished by type alone.