So I have an abstract type with allocatable length strings
type, abstract:: firstType character(len=:), allocatable:: one, two contains end type
I want to be able to include a final subroutine:
type, abstract:: firstType character(len=:), allocatable:: one contains final:: destroyFirst end type contains subroutine destroyFirst(typeIn) end subroutine
Is it possible? When I try to use type(firstType) then I get
error #8313: The TYPE(derived-type-spec) shall not specify an abstract type.
but when I try to use class(firstType) I get the error
error #8339: The dummy argument of a final subroutine must be a variable of the derived type being defined and cannot be optional, pointer, allocatable, or polymorphic.
Is it possible to finalise an abstract type?