(j3.2006) More allowed but not wanted?

Van Snyder Van.Snyder
Tue Oct 7 16:55:58 EDT 2014


This appears to be allowed, but I think it's not what we want:

  type :: T1
    class(*), allocatable :: U
  end type T1

  type :: T2
    type(t1), allocatable :: C
  end type T2

  type(t2) :: V[*]

  call s ( v[2] )

The intent of C617 appears to be that one ought not to be able to
exploit the polymorphism of V[2]%C%U, but V[2]%C%U is not a subcomponent
of V[2], because V[2]%C is allocatable.

Is this what we wanted?

If not, and we repair it, probably by saying "subobject" instead of
"subcomponent," is there still a problem with

  type :: T1
    class(*), pointer :: U
  end type T1

  type :: T2
    type(t1), allocatable :: C
  end type T2

  type(t2) :: V[*]

What was the point of the second part of C617, assuming "subcomponent"
is correct, or can be trivially corrected?  The first part prevents
actually designating V[2]%C%U, no matter whether it's allocatable or a
pointer.





More information about the J3 mailing list