2 ! Test the fix for PR46897.
4 ! Contributed by Rouson Damian <rouson@sandia.gov>
12 generic
:: assignment(=)=>assign0
15 type(component
) :: foo
17 type, extends(parent
) :: child
21 subroutine assign0(lhs
,rhs
)
22 class(component
), intent(out
) :: lhs
23 class(component
), intent(in
) :: rhs
26 type(child
) function new_child()
36 generic
:: assignment(=)=>assign1
39 type(component1
) :: foo
42 subroutine assign1(lhs
,rhs
)
43 class(component1
), intent(out
) :: lhs
44 class(component1
), intent(in
) :: rhs
54 interface assignment(=)
55 module procedure assign2
58 type(component2
) :: foo
61 subroutine assign2(lhs
,rhs
)
62 type(component2
), intent(out
) :: lhs
63 type(component2
), intent(in
) :: rhs
73 type(child
) :: infant0
74 type(t
) :: infant1
, newchild1
75 type(t2
) :: infant2
, newchild2
77 ! Test the reported problem.
79 if (infant0
%parent
%foo
%i
.ne
. 20) STOP 1
81 ! Test the case of comment #1 of the PR.
83 if (infant1
%foo
%i
.ne
. 21) STOP 2
85 ! Test the case of comment #2 of the PR.
87 if (infant2
%foo
%i
.ne
. 2) STOP 3