(j3.2006) derived types with type parameters are different

Robert Corbett Robert.Corbett
Wed Jul 30 00:42:37 EDT 2008


Van Snyder wrote:
> On Mon, 2008-07-28 at 22:31 -0700, Robert Corbett wrote:
> 
>>       C433 (R429) If SEQUENCE appears, the derived-type
>>            shall not have type parameters and the
>>            type-bound-procedure-part shall not appear.
> 
> 
> An alternative solution is
> 
> 1.  Replace "type parameters" in the fifth line of 4.5.2.4p2 with "kind
> type parameters that agree in order, name and value,"
> 
> I don't think we need the following, since automatic objects are already
> prohibited in EQUIVALENCE and COMMON, but we might want them anyway
> since it has been asserted that the only way to do length type
> parameters is with allocatable components, and objects with allocatable
> components are prohibited in EQUIVALENCE and COMMON.
> 
> 2.  Insert "that has a length type parameter or" before "that has a
> pointer" in C583 in 5.7.1.1
> 
> 3.  Insert ", it shall not have a length type parameter," after
> "SEQUENCE attribute" in C597 in 5.7.2.1.

Something like this could be made to work, but it is more difficult to
do it right than one might expect.  For example, would

       TYPE T(N)
         INTEGER, KIND :: N
         SEQUENCE
         REAL A(1)
       END TYPE

potentially be the same type as

       TYPE T(N)
         INTEGER, KIND :: N
         SEQUENCE
         REAL A(N)
       END TYPE

?

If so, what does that mean for checking generic interfaces for
conflicts?

Bob Corbett



More information about the J3 mailing list