To: J3 J3/10-140 From: Stan Whitlock Subject: F2008 edits for interp F03/0090 Date: 2010 February 16 1. Introduction Interp F03/0090 passed as amended in WG5 ballot #7 {N1805/6/16}. These comments were accepted: * Long comment Should the edit for [68:9] also be applied to [68:11]? YES * Cohen no There is no edit that prohibits an array contructor ac-value from being unlimited polymorphic (i.e. CLASS(*)); we should state this directly, not make people infer it from more difficult rules. Proposed fix: [67:19+] Insert new constraint "An shall not be unlimited polymorphic.". 2. The final form of F03/0090 is NUMBER: F03/0090 TITLE: Polymorphic array constructors KEYWORDS: polymorphic, array constructor DEFECT TYPE: Erratum STATUS: Passed by WG5 ballot QUESTION: (1) Consider FUNCTION f1(dummy,n) CLASS(t) dummy TYPE(t) f1(n) f1 = [ (dummy,i=1,n) ] END FUNCTION Is this standard-conforming? (2) If the array constructor elements are polymorphic, is the array constructor polymorphic with the dynamic type of the elements? For example, consider FUNCTION f2(dummy,n) CLASS(t) dummy CLASS(t),ALLOCATABLE :: f2(:) IF (...) THEN ALLOCATE(f2(n),SOURCE=[(dummy,i=1,n)]) ! **1 ELSE ALLOCATE(f2(n),SOURCE=dummy) ! **2 END IF END FUNCTION The second ALLOCATE statement (marked **2) clearly allocates F2 with size N and the dynamic type of DUMMY. If the array constructor is polymorphic, the first ALLOCATE statement (marked **1) will have the same effect, otherwise it will allocate F2 with the dynamic type of F2 equal to the declared type of DUMMY. (3) If the array constructor is polymorphic, what is the dynamic type when multiple items have different dynamic types? ANSWER: (1) Yes. (2) No, it was not intended for array constructors to be polymorphic. A polymorphic array value, if desired, can be safely constructed by using an allocatable array function. (3) Not applicable. An edit is provided to clarify the situation. EDITS: [67:19+] Insert new constraint "CXXX (R469) An shall not be unlimited polymorphic.". [67:21] "same type" -> "same declared type" [68:9] "type and" -> "declared type and" [69:11] "type and" -> "declared type and" [68:14+] Insert new paragraph "The dynamic type of the array constructor is the same as its declared type." SUBMITTED BY: Van Snyder HISTORY: 07-231 m180 F03/0090 submitted (revised by M. Cohen) 07-231 m180 Passed by J3 meeting 07-272 m181 Failed J3 letter ballot #13 07-250r1 09-266 m189 Revised answer - Passed by J3 meeting 09-295 m190 Passed as amended by J3 letter ballot #19 09-292 N1816 m191 Passed as amended by WG5 ballot #7 {N1805/6} 3. Edits to fix F2008 09-007r3 to include the edits from F03/0090 EDITS: [85:3+] Insert new constraint "CXXX (R472) An shall not be unlimited polymorphic.". [85:4] "same type" -> "same declared type" [85:14] "type and" -> "declared type and" [85:15] "type and" -> "declared type and" [85:18+] Insert new paragraph "The dynamic type of the array constructor is the same as its declared type."