1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Test polymorphic restrictions
6 type, extends(base
) :: t
10 generic
:: write(formatted
) => fwrite
13 subroutine fwrite(x
, unit
, iotype
, vlist
, iostat
, iomsg
)
14 class(t
), intent(in
) :: x
15 integer, intent(in
) :: unit
16 character(*), intent(in
) :: iotype
17 integer, intent(in
) :: vlist(:)
18 integer, intent(out
) :: iostat
19 character(*), intent(in out
) :: iomsg
20 write(unit
, *, iostat
=iostat
, iomsg
=iomsg
) '(', iotype
, ':', vlist
, ':', x
%n
, ')'
22 subroutine subr(x
, y
, z
)
23 class(t
), intent(in
) :: x
24 class(base
), intent(in
) :: y
25 class(*), intent(in
) :: z
27 !ERROR: Derived type 'base' in I/O may not be polymorphic unless using defined I/O
29 !ERROR: I/O list item may not be unlimited polymorphic
36 call subr(t(123),t(234),t(345))