! C737 If EXTENDS appears and the type being defined has a potential
! subobject component of type EVENT_TYPE or LOCK_TYPE from the intrinsic
! module ISO_FORTRAN_ENV, its parent type shall be EVENT_TYPE or LOCK_TYPE
! or have a potential subobject component of type EVENT_TYPE or LOCK_TYPE.
modulenot_iso_fortran_env
typeevent_type
endtype
typelock_type
endtype
endmodule
subroutineC737_a()
useiso_fortran_env
typelockGrandParentType
type(lock_type)::grandParentField
endtypelockGrandParentType
type,extends(lockGrandParentType)::lockParentType
real::parentField
endtypelockParentType
typeeventParentType
type(event_type)::parentField
endtypeeventParentType
typenoLockParentType
endtypenoLockParentType
type,extends(lockParentType)::goodChildType1
type(lock_type)::childField
endtypegoodChildType1
type,extends(lockParentType)::goodChildType2
type(event_type)::childField
endtypegoodChildType2
type,extends(lock_type)::goodChildType3
type(event_type)::childField
endtypegoodChildType3
type,extends(event_type)::goodChildType4
type(lock_type)::childField
endtypegoodChildType4
!ERROR: Type 'badchildtype1' has an EVENT_TYPE or LOCK_TYPE component, so the type at the base of its type extension chain ('nolockparenttype') must either have an EVENT_TYPE or LOCK_TYPE component, or be EVENT_TYPE or LOCK_TYPE
type,extends(noLockParentType)::badChildType1
type(lock_type)::childField
endtypebadChildType1
!ERROR: Type 'badchildtype2' has an EVENT_TYPE or LOCK_TYPE component, so the type at the base of its type extension chain ('nolockparenttype') must either have an EVENT_TYPE or LOCK_TYPE component, or be EVENT_TYPE or LOCK_TYPE
type,extends(noLockParentType)::badChildType2
type(event_type)::childField
endtypebadChildType2
!ERROR: Type 'badchildtype3' has an EVENT_TYPE or LOCK_TYPE component, so the type at the base of its type extension chain ('nolockparenttype') must either have an EVENT_TYPE or LOCK_TYPE component, or be EVENT_TYPE or LOCK_TYPE
type,extends(noLockParentType)::badChildType3
type(lockParentType)::childField
endtypebadChildType3
!ERROR: Type 'badchildtype4' has an EVENT_TYPE or LOCK_TYPE component, so the type at the base of its type extension chain ('nolockparenttype') must either have an EVENT_TYPE or LOCK_TYPE component, or be EVENT_TYPE or LOCK_TYPE
type,extends(noLockParentType)::badChildType4
type(eventParentType)::childField
endtypebadChildType4
endsubroutineC737_a
subroutineC737_b()
usenot_iso_fortran_env
typelockParentType
type(lock_type)::parentField
endtypelockParentType
typenoLockParentType
endtypenoLockParentType
! actually OK since this is not the predefined lock_type
type,extends(noLockParentType)::notBadChildType1
type(lock_type)::childField
endtypenotBadChildType1
! actually OK since this is not the predefined event_type