3 ! PR 57843: [OOP] Type-bound assignment is resolved to non-polymorphic procedure call
5 ! Contributed by John <jwmwalrus@gmail.com>
11 procedure
:: the_assignment
=> assign_itemType
12 generic
:: assignment(=) => the_assignment
15 subroutine assign_itemType(left
, right
)
16 class(itemType
), intent(OUT
) :: left
17 class(itemType
), intent(IN
) :: right
24 type, extends(itemType
) :: myItem
25 character(3) :: name
= ''
27 procedure
:: the_assignment
=> assign_myItem
30 subroutine assign_myItem(left
, right
)
31 class(myItem
), intent(OUT
) :: left
32 class(itemType
), intent(IN
) :: right
35 left
%name
= right
%name
46 class(itemType
), allocatable
:: item1
, item2
48 allocate (myItem
:: item1
)
54 allocate (myItem
:: item2
)
59 if (item2
%name
/= 'abc') STOP 1