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

Van Snyder Van.Snyder
Thu Nov 12 16:32:00 EST 2015


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?

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





More information about the J3 mailing list