(j3.2006) Student misconceptions
Fri Sep 12 20:04:09 EDT 2008
At least two newcomers to Fortran 2003 with whom I have recently come
into contact do not realize that type compatibility is not symmetric.
It would be helpful to have a note in 18.104.22.168 to that effect. Something
Type compatibility is not symmetric. An entity of an extension
type is not type compatible with an entity of a type of which it
is an extension. An entity that has a declared type is not type
compatible with an unlimited polymorphic entity.
Those same two students thought they had to declare associate names to
get them to have the correct type, kind, rank and bounds, as is
necessary for statement function dummy arguments and FORALL induction
variables, even though 22.214.171.124 and 126.96.36.199 are quite explicit. Perhaps
they missed the last two sentences of 188.8.131.52p1, the topic of which
should arguably be in 184.108.40.206p1. Moving those sentences to be after the
first sentence of 220.127.116.11p1 is a reasonable solution.
This confusion is perhaps abetted by not stating in 18.104.22.168 that
entities from the scope containing the SELECT TYPE or ASSOCIATE
construct that have the same name as an associate name are not
accessible within the construct by that name (just like the case of host
association). It does say so in 16.4p2. A note after 22.214.171.124p1
something like the following might solve the problem:
Within the construct, an entity identified by a global or
local name that is the same as an associate name is not
accessible by that name (16.4).
More information about the J3