1 ! RUN: %S/test_errors.sh %s %t %flang_fc1
3 ! Extended derived types
8 !ERROR: Component 'x' is already declared in this derived type
17 type, extends(t1
) :: t2
18 !ERROR: Component 'i' is already declared in a parent of this derived type
26 type, extends(t1
) :: t2
28 !ERROR: 't1' is a parent type of this type and so cannot be a component
33 type, extends(t3
) :: t4
35 type, extends(t4
) :: t5
36 !ERROR: 't3' is a parent type of this type and so cannot be a component
45 !ERROR: Type cannot be extended as it has a component named 't1'
46 type, extends(t1
) :: t2
54 type, extends(t1
) :: t2
56 !ERROR: Type cannot be extended as it has a component named 't2'
57 type, extends(t2
) :: t3
62 ! t1 can be extended if it is known as anything but t3
66 type, extends(t1
) :: t2
70 use :: m6
, only
: t3
=> t1
71 !ERROR: Type cannot be extended as it has a component named 't3'
72 type, extends(t3
) :: t4
76 use :: m6
, only
: t5
=> t1
77 type, extends(t5
) :: t6
85 type, extends(t1
) :: t2
87 integer, private
:: i3
95 !ERROR: PRIVATE component 'i3' is only accessible within module 'm7'
97 !ERROR: PRIVATE component 't1' is only accessible within module 'm7'
105 integer, private
:: i2
112 x
= t(i1
=2, i2
=5) !OK
121 !ERROR: PRIVATE component 'i2' is only accessible within module 'm8'
123 !ERROR: PRIVATE component 'i2' is only accessible within module 'm8'
125 !ERROR: PRIVATE component 'i2' is only accessible within module 'm8'
132 module subroutine s()
137 integer, private
:: i2
144 x
= t(i1
=2, i2
=5) !OK