On Thu, Mar 22, 2018 at 4:09 PM, Bill Long <[log in to unmask]> wrote:
> I believe that the type-bound-procedure wins. ..
Bill,
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:
module m
type :: t
integer :: i = 0 !<--- A
contains
procedure :: assign_class_t
generic :: assignment(=) => assign_class_t
end type
contains
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 subroutine
end module m
program test
use m
type(t),allocatable :: foo
foo = t()
end program test
Thanks,
Vipul Parekh
|