(j3.2006) FW: 11-229 J3 Fortran interp letter ballot #24 - due 19-Aug-2011 - 2nd try

Malcolm Cohen malcolm
Thu Aug 18 22:17:04 EDT 2011


Bill Long wrote:
>Comment for F03/0120:
>--------------------------------
...
>Finally, the text of the subsequent subroutine S contains:
>
>       SUBROUTINE S(N)
>         USE M1, T1=>T
>         USE M2, T2=>T
>         TYPE(T(N)) :: X
>         TYPE(T(N)) :: Y
>         Y%A = 0.0
>         X = Y
>       END
>
>which seems baffling. With the type T from each of the modules renamed to T1 
>and T2 locally, there is no type named T visible here.  Yet the declarations of 
>X and Y both use type T(N).  The compiler was displeased.

Clearly (!) X and Y should be declared with T1 and T2 not T, otherwise there is 
no question of whether they are the same type or not.

>I think the following alternative demonstrates what was intended (and also 
>seems to compile and execute as one might expect):

Except that
(a) it does not demonstrate the question as there are no sequence types with the 
same name, therefore no sequence types that might be the same type,
and
(b) it is straightforwardly invalid as the derived-type definitions don't 
specify the same name as required by 4.5.2.4p2; I hope your compiler catches 
that if they are module procedures!

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




More information about the J3 mailing list