Hi,
I don't see quite what it is you think you are trying to do here.
An abstract type cannot be instantiated, i.e. you cannot have a
variable whose dynamic type is an abstract type.
Your base type has a private deferred type-bound procedure.
Being private, this means that outside the module you cannot ever
extend the abstract type to get a non-abstract type. So if for the
sake of argument the compiler allowed you to extend the type, you
cannot ever actually do anything useful with it, like create a value
or variable of such an extension or of any extension of that.
Of course private deferred type-bound procedures are useful in
themselves, but only if you extend the type within the module.
That is precisely their use; you have an abstract type in the
module, with private deferred tbps, you extend it in the module
to provide the extensions (with those tbps non-deferred!) you
want, and can export all the types and know that any polymorphic
object whose declared type is the base type will have a dynamic
type which is one of your particular extensions (or an extension
thereof). It is also useful even if you don't export the parent
type, if these tbps are for internal use and you don't want to
clutter the namespace of a user extension.
A bit esoteric, but as long as you extend the type inside the
module to provide an extension that doesn't have those deferred
any more, it does have its uses.
Maybe there is something I'm missing here. Perhaps you can explain
more (in private email rather than list email if you think it's not
interesting to the list).
This week I'm at a Fortran standards meeting so the responses
might be a bit slow, but I'll try to check me email every day
at least.
It is also possible that even though it is (I believe) useless to
extend abstract types that have private deferred tbps outside their
defining module, the NAG compiler should be giving a warning saying
something like "This is completely useless" instead of rejecting the
program. I'll take a look at that too, but first I'd rather try to
understand what it is you are wanting to achieve as the end result.
Cheers,
--
..................Malcolm Cohen (Nihon NAG, Tokyo, Japan).
|