1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Extended derived types
7 !ERROR: Component 'x' is already declared in this derived type
16 type, extends(t1
) :: t2
17 !ERROR: Component 'i' is already declared in a parent of this derived type
25 type, extends(t1
) :: t2
27 !ERROR: 't1' is a parent type of this type and so cannot be a component
32 type, extends(t3
) :: t4
34 type, extends(t4
) :: t5
35 !ERROR: 't3' is a parent type of this type and so cannot be a component
44 !ERROR: Type cannot be extended as it has a component named 't1'
45 type, extends(t1
) :: t2
53 type, extends(t1
) :: t2
55 !ERROR: Type cannot be extended as it has a component named 't2'
56 type, extends(t2
) :: t3
61 ! t1 can be extended if it is known as anything but t3
65 type, extends(t1
) :: t2
69 use :: m6
, only
: t3
=> t1
70 !ERROR: Type cannot be extended as it has a component named 't3'
71 type, extends(t3
) :: t4
75 use :: m6
, only
: t5
=> t1
76 type, extends(t5
) :: t6
84 type, extends(t1
) :: t2
86 integer, private
:: i3
94 !ERROR: PRIVATE name 'i3' is only accessible within module 'm7'
96 !ERROR: PRIVATE name 't1' is only accessible within module 'm7'
104 integer, private
:: i2
111 x
= t(i1
=2, i2
=5) !OK
120 !ERROR: PRIVATE name 'i2' is only accessible within module 'm8'
122 !ERROR: PRIVATE name 'i2' is only accessible within module 'm8'
124 !ERROR: PRIVATE name 'i2' is only accessible within module 'm8'
131 module subroutine s()
136 integer, private
:: i2
143 x
= t(i1
=2, i2
=5) !OK
152 generic
, private
:: operator(+) => f
155 type(t
) function f(x
,y
)
156 class(t
), intent(in
) :: x
, y
164 !ERROR: PRIVATE name 'operator(+)' is only accessible within module 'm10'