On Thu, Mar 22, 2018 at 4:09 PM, Bill Long <[log in to unmask]> wrote:
> I believe that the type-bound-procedure wins. ..
Do you think the standard states anywhere "the type-bound procedure
wins"? In your modified example with the 3 compilers you tried, what
"fun" will happen with any instruction involving the passed object?!
As in say the modification below, note the lines marked A and B:
type :: t
integer :: i = 0 !<--- A
procedure :: assign_class_t
generic :: assignment(=) => assign_class_t
subroutine assign_class_t( this, rhs )
class(t), intent(inout) :: this
type(t), intent(in) :: rhs
print *, "called assign_class_t"
this%i = rhs%i !<--- B
end module m
type(t),allocatable :: foo
foo = t()
end program test