(j3.2006) Parent component of extension of abstract type

Bill Long longb
Thu Nov 12 17:13:21 EST 2015


On Nov 12, 2015, at 3:32 PM, Van Snyder <Van.Snyder at jpl.nasa.gov> wrote:

> It seems a bit strange that I can't access the parent component of an
> object of a type that is an extension of an abstract type, but I can
> access components of the parent component.  Is this what we intended?

You?re not allowed to declare an object of an abstract type.  So it would seem odd to allow a designator for an object of an abstract type. 

Cheers,
Bill

> 
> program P
> 
>  type, abstract :: T0
>    integer :: N = 42
>  end type T0
> 
>  type, extends(t0) :: T1
>  end type T1
> 
>  type(t1) :: V1, V2
> 
>  print '(a,i0)', 'V1 ', v1
>  print '(a,i0)', 'V1%T0 ', v1%t0      ! Prohibited
>  print '(a,i0)', 'V1%T0%n ', v1%t0%n
> 
>  v2 = v1
>  v2%t0 = v1%t0                        ! Prohibited
>  v2%t0%n = v1%t0%n
> 
> end program P
> 
> 
> _______________________________________________
> J3 mailing list
> J3 at mailman.j3-fortran.org
> http://mailman.j3-fortran.org/mailman/listinfo/j3

Bill Long                                                                       longb at cray.com
Fortran Technical Support  &                                  voice:  651-605-9024
Bioinformatics Software Development                     fax:  651-605-9142
Cray Inc./ Cray Plaza, Suite 210/ 380 Jackson St./ St. Paul, MN 55101





More information about the J3 mailing list