To: J3 J3/22-100r1 From: John Reid Subject: F18/031 revised Date: 2022-March-03 References: 18-007r1, 21-173, 21-184r1 Discussion ---------- After discussion, of the two alternatives A and B in 22-100, alternative A was chosen. Alternative B has been removed from this paper. ---------------------------------------------------------------------- NUMBER: F18/031 TITLE: CO_BROADCAST with polymorphic argument DEFECT TYPE: Erratum STATUS: Passed by J3 meeting QUESTION: Consider the code fragment Subroutine asgn_for_image(a,b,srcimg) Class(*) a,b Integer,Intent(In) :: srcimg ! The assignment A = B is not allowed, so... If (This_Image()==srcimg) Then Call asgn(b) Else Call asgn(a) End If Contains Subroutine asgn(x) Class(*) x Call co_broadcast(x,Source_Image=srcimg) End Subroutine End Subroutine There is no requirement forbidding the A argument of CO_BROADCAST from being polymorphic, so on the face of it, this appears to get around the prohibition against nonallocatable polymorphic assignment. However, CO_BROADCAST states "A becomes defined, as if by intrinsic assignment" but intrinsic assignment is not defined when the variable is a nonallocatable polymorphic. It can be convincingly argued that the standard therefore does not establish an interpretation, and thus the call to CO_BROADCAST is not valid. Philosophically, it would seem to be strange to allow polymorphic broadcast across images, but not to allow polymorphic assignment of a single variable within an image let alone across images. Is the call to CO_BROADCAST in the example standard-conforming? (And if so, what are the actual semantics?) ANSWER: No, this was not intended to be conforming. Edits are supplied to correct this. EDITS to 18-007r1: [355:19] 16.9.46 CO_BROADCAST, p3 Arguments, argument A, sentence 1, delete "dynamic" to make the sentence read "A shall have the same shape, type, and type parameter values, in corresponding references." {The word "dynamic" would be confusing here.} [355:20] 16.9.46 CO_BROADCAST, p3 Arguments, argument A, sentence 2, after "It shall not be" insert "polymorphic or" making the sentence read "It shall not be polymorphic or a coindexed object." SUBMITTED BY: Malcolm Cohen HISTORY: 21-151 m224 Submitted 21-151r1 m224 Eliminated alternative answer, passed by J3 meeting 224. 21-184r1 m225 Failed J3 letter ballot. 22-100 m226 Revised 22-100r1 m226 Passed by J3 meeting 226. ----------------------------------------------------------------------