To: J3 J3/22-108 From: John Reid Subject: Allocating unlimited-polymorphic objects Date: 2022-January-15 References: 22-007, 21-199r1, 22-104 Discussion ---------- If a non-coarray of unlimited-polymorphic type were allowed to be allocated to have a dynamic type with a coarray potential subobject component, its deallocation would be an image control statement. It was intended to disallow this because it is undesirable to have a data value determine whether a statement is an image control statement. The dynamic type given to an of unlimited-polymorphic type is the type specified by or the dynamic type of . 21-199r1 proposed adding "If an is unlimited polymorphic, the dynamic type of neither nor shall have a coarray potential subobject component." The editor changed this (see 22-104) to "If an is unlimited polymorphic, the dynamic type of shall not have a coarray potential subobject component." because the suggested restriction on can be expressed as a constraint. The editor made this new edit [142:5-6] C941, "or type TEAM_TYPE" -> "type TEAM_TYPE", after "ISO_FORTRAN_ENV" insert ", or a type that has a coarray potential subobject component". Unfortunately, this constraint starts "If an allocate-object is a coarray," rather than "If an is unlimited polymorphic," so a new constraint is needed. The restriction on can also be expressed as a constraint. A restriction on its declared type is sufficient in view of the constraint on : C741 (R726) If EXTENDS appears and the type being defined has a coarray potential subobject component, its parent type shall have a coarray potential subobject component. A new constraint on the type specified by and the declared type of is proposed. This replaces the two changes made to 21-007r2 that were discussed above. Edits to 22-007 -------------- [142:5-6] In 9.7.1.1 Form of the ALLOCATE statement, C941, change "type TEAM_TYPE" to "or type TEAM_TYPE" and delete ", or a type that has a coarray potential subobject component" so that it reads "C941 (R929) If an allocate-object is a coarray, type-spec shall not specify type C_PTR or C_FUNPTR from the intrinsic module ISO_C_BINDING, or type TEAM_TYPE from the intrinsic module ISO_FORTRAN_ENV." [142:6+] In 9.7.1.1 Form of the ALLOCATE statement, after "C941 (R929) If an allocate-object is a coarray, ..." add "C941a (R929) If an is unlimited polymorphic, neither the type specified by nor the declared type of shall have a coarray potential subobject component." [143:11-12] In 9.7.1.1 Form of the ALLOCATE statement, para 5, delete the final sentence "If an is unlimited polymorphic, the dynamic type of shall not have a coarray potential subobject component."