5 ! Check whether default initialization works with INTENT(OUT)
6 ! and ALLOCATABLE and no segfault occurs with OPTIONAL.
22 class(typ1
), intent(out
), optional
:: y1
29 type, extends(mytype
):: mytype2
32 class(mytype
), allocatable
:: x
,y
33 allocate (mytype2
:: x
)
35 if (allocated (x
) .or
. .not
. same_type_as (x
,y
)) STOP 2
37 allocate (mytype2
:: x
)
39 if (allocated (x
) .or
. .not
. same_type_as (x
,y
)) STOP 3
44 class(mytype
), intent(out
), allocatable
:: y2
47 class(mytype
), optional
, intent(out
), allocatable
:: y3