J3/03-132 To: J3 From: UK Fortran panel Subject: Edits for UK comment TC5 (Change to type extension) Date: 10 March 2003 Comment TC5 of the UK vote was: Remove the facility to add type parameters during type extension. A derived type statement with an EXTENDS clause shall not declare any type parameters. The current description is incorrect, as SELECT TYPE provides no way to discover the values of any kind type parameters that were added during type extension. Furthermore, this feature complicates the language and adds little benefit. When constructing the edits for this, we realized that this change would make CLASS(*) irregular since an object of CLASS(*) has no type parameters but is type compatible with objects that do. Also, it would not obviate the need to correct SELECT TYPE, since this is needed for CLASS(*) objects. Therefore, we wish to change our comment to a request for correcting SELECT TYPE. Edits follow. {Note: These edits are all superseded if TC6 is adopted.} 162:16,17. Change "" to "". {We need new BNF for type specifiers that exclude nonkind type params.} 162:19-20. Delete. {We'll handle this in our new rule.} 162:25+. Insert new rules and constraints: R823a <> [ ( ) ] C815a (R823a) shall be the name of an extensible type. C815b (R823a) If is not unlimited polymorphic, shall be the name of an extension of the declared type of . C815c (R823a) There shall be exactly one corresponding to each kind type parameter of the type and none corresponding to a nonkind type parameter. If UK comment TC3 is accepted, the third new constraint will need to be C815c (R823a) There shall be exactly one corresponding to each kind type parameter of the type that does not have a default value, at most one corresponding to each kind type parameter of the type that has a default value, and none corresponding to a nonkind type parameter. {New rule.} 162:21. Change '' to 'type and kind type parameter values'. 163:6-14. Replace by EITHER The block to be executed is selected as follows: (1) If the dynamic type and kind type parameter values of the selector are the same as those specified by a TYPE IS type guard statement, the block following that statement is executed. (2) Otherwise, if exactly one CLASS IS type guard statement specifies a type of which the dynamic type of the selector is an extension and specifies kind type parameter values that match the corresponding type parameter values of the dynamic type of the selector, the block following that statement is executed. (3) Otherwise, if several CLASS IS type guard statements match as in (2), one of these statements must specify a type that is an extension of all the types specified in the others; the block following that statement is executed. OR A TYPE IS type guard statement matches the selector if the dynamic type and type parameter values of the selector are the same as those specified by the statement. A CLASS IS type guard statement matches the selector if the dynamic type of the selector is an extension of the type specified by the statement and the kind type parameter values specified by the statement are the same as the corresponding type parameter values of the dynamic type of the selector. The block to be executed is selected as follows: (1) If a TYPE IS type guard statement matches the selector, the block following that statement is executed. (2) Otherwise, if exactly one CLASS IS type guard statement matches the selector, the block following that statement is executed. (3) Otherwise, if several CLASS IS type guard statements match the selector, one of these statements must specify a type that is an extension of all the types specified in the others; the block following that statement is executed. 163:18,21,24: Change 'type parameters' to 'type parameter values' on all three lines. {In many places, the standard uses 'type parameter' when the context makes it clear that 'type parameter value' is what is really meant. Here, we think it needs to be written in full to make the meaning clear.} 163:22 Replace line by are the corresponding type parameter values of the selector.