1 ! RUN: %python %S/test_errors.py %s %flang_fc1
4 procedure(baseSub
), pointer :: baseComponent
6 type, extends(base
) :: extended
10 class(base
), intent(in
) :: x
12 subroutine extendedSub(x
)
13 class(extended
), intent(in
) :: x
16 procedure(baseSub
), pointer :: basePtr
17 procedure(extendedSub
), pointer :: extendedPtr
18 type(extended
) :: extendedVar
19 extendedPtr
=> baseSub
! ok
20 extendedPtr
=> basePtr
! ok
21 extendedVar
= extended(baseSub
) ! ok
22 extendedVar
= extended(basePtr
) ! ok
23 !ERROR: Procedure pointer 'baseptr' associated with incompatible procedure designator 'extendedsub': incompatible dummy argument #1: incompatible dummy data object types: CLASS(extended) vs CLASS(base)
24 basePtr
=> extendedSub
25 !ERROR: Procedure pointer 'baseptr' associated with incompatible procedure designator 'extendedptr': incompatible dummy argument #1: incompatible dummy data object types: CLASS(extended) vs CLASS(base)
26 basePtr
=> extendedPtr
27 !ERROR: Procedure pointer 'basecomponent' associated with incompatible procedure designator 'extendedsub': incompatible dummy argument #1: incompatible dummy data object types: CLASS(extended) vs CLASS(base)
28 extendedVar
= extended(extendedSub
)
29 !ERROR: Procedure pointer 'basecomponent' associated with incompatible procedure designator 'extendedptr': incompatible dummy argument #1: incompatible dummy data object types: CLASS(extended) vs CLASS(base)
30 extendedVar
= extended(extendedPtr
)