(j3.2006) Intrinsic assignment of derived types

Malcolm Cohen malcolm
Sat Feb 3 20:01:18 EST 2018


  Referencing 18-007, 10.2.1.2 requires that the type of the expr be "the same derived type as the variable". Here they are of the same declared type, but not the same dynamic type.


No, subclause 10.2.1.2  does not have that requirement.  The words are ?the declared types of the variable and expr shall conform as specified in Table 10.8,?

QED. 

Also any compiler claiming CLASS( T ) is declaring a different type from TYPE( T ) needs serious remedial attention.

  Would it be correct/useful to change the words in table 10.8 to say "same dynamic type"?

That would be a direct contradiction since the requirement is on the declared types.  So no.

(We very carefully wrote the semantics of intrinsic assignment to make this feature work!  We have no notation for selecting the declared part of a polymorphic variable ? instead, the design is that in nonpoly contexts, the declared part is what gets used; this feature is part of that design.)

Cheers,
-- 
..................................Malcolm.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.j3-fortran.org/pipermail/j3/attachments/20180204/6ee05678/attachment.html>



More information about the J3 mailing list