45 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! C736 If EXTENDS appears and the type being defined has a coarray ultimate 3! component, its parent type shall have a coarray ultimate component.4!5subroutine s()6 type coarrayParent7 real,allocatable, codimension[:] :: parentField8 end type coarrayParent9 10 type, extends(coarrayParent) :: goodChildType11 real, allocatable, codimension[:] :: childField12 end type goodChildType13 14 type, extends(coarrayParent) :: brotherType15 real :: brotherField16 end type brotherType17 18 type, extends(brotherType) :: grandChildType19 real, allocatable, codimension[:] :: grandChildField20 end type grandChildType21 22 type plainParent23 end type plainParent24 25 !ERROR: Type 'badchildtype' has a coarray ultimate component so the type at the base of its type extension chain ('plainparent') must be a type that has a coarray ultimate component26 type, extends(plainParent) :: badChildType27 real, allocatable, codimension[:] :: childField28 end type badChildType29 30 type, extends(plainParent) :: plainChild31 real :: realField32 end type plainChild33 34 !ERROR: Type 'badchildtype2' has a coarray ultimate component so the type at the base of its type extension chain ('plainparent') must be a type that has a coarray ultimate component35 type, extends(plainChild) :: badChildType236 real, allocatable, codimension[:] :: childField37 end type badChildType238 39 !ERROR: Type 'badchildtype3' has a coarray ultimate component so the type at the base of its type extension chain ('plainparent') must be a type that has a coarray ultimate component40 type, extends(plainParent) :: badChildType341 type(coarrayParent) :: childField42 end type badChildType343 44end subroutine s45