(j3.2006) About extending abstract types with deferred bindings

Cohen Malcolm malcolm
Thu Sep 8 04:28:48 EDT 2016


Your ancestor component *IS* an object of abstract type.

-----Original Message----- 
From: Van Snyder
Sent: Thursday, September 8, 2016 5:22 PM
To: j3 at mailman.j3-fortran.org
Subject: Re: (j3.2006) About extending abstract types with deferred bindings

On Thu, 2016-09-08 at 17:15 +0900, Cohen Malcolm wrote:
> <<<
> Is there a prohibition against invoking an accessible deferred
> procedure
> binding using an abstract ancestor component of a non-abstract object?
> >>>
>
> In effect.  The rules prevent instantiating an object of abstract type
> in
> the first place.

You don't need an object of abstract type to do this.  An ancestor
component of abstract type, of an object of concrete type, is of
abstract type.  The object of concrete type can be instantiated.

type, abstract :: T1
...
contains
  procedure(...), deferred :: P1
end type T1

type, extends(t1) :: T2
...
contains
  procedure(...) :: P1
end type T2

type(t2) :: X

  call x%t1%p1


_______________________________________________
J3 mailing list
J3 at mailman.j3-fortran.org
http://mailman.j3-fortran.org/mailman/listinfo/j3

________________________________________________________________________
This e-mail has been scanned for all viruses by Star.
________________________________________________________________________

-- 
........................Malcolm Cohen, Nihon NAG, Tokyo. 




More information about the J3 mailing list