J3/15-161 To: J3 From: Van Snyder Subject: Interp: assign to deferred-length coindexed character Date: 2015 June 06 ---------------------------------------------------------------------- NUMBER: F08/nnnn TITLE: Assign to deferred-length coindexed character variable KEYWORDS: Cobounds, type declaration DEFECT TYPE: Erratum STATUS: J3 consideration in progress QUESTION: Consider the program: character(:), allocatable :: C[*] allocate ( character(42) :: C ) c = 'stuff' end Is the assignment permitted? ANSWER: 7.2.1.2p2 is poorly written. Taking only the introductory sentence and the third list item, one has the nongrammatical nonsense "If is a coindexed object, the variable each deferred length type parameter shall have the same value as the corresponding type parameter of ." Nonetheess, one can penetrate its intent, which is that if a variable is a coindexed object, each deferred length type parameter of the variable shall have the same value as the corresponding length type parameter of the expression. In the question, the length type parameter values are 42 and 5. Therefore the assignment is prohibited. 7.2.1.2p1(8) clearly contemplates that the requirement does not apply to character variables that are not coindexed. Further, 7.2.1.3p10 explains how character assignment works when the length type parameter values differ. 7.2.1.3p10 does not make any distinction between coindexed variables and variables that are not coindexed. It was intended that the assignment be allowed, and that assignment to character variables that are coindexed work the same way as assignment to character variables that are not coindexed. Edits are provided to correct this mistake. EDITS: Replace 7.2.1.2p2 with the following paragraph: "If is a coindexed object then o the variable shall not be polymorphic, o the variable shall not have an allocatable ultimate component, and o if the variable is of derived type, each of its deferred length type parameters shall have the same value as the corresponding type parameter of . " SUBMITTED BY: Van Snyder HISTORY: 15-xxx m207 F08/nnnn submitted ----------------------------------------------------------------------