!standard 12.5.1(5.1/2) 11-03-11 AI05-0237-1/02 !class binding interpretation 11-01-30 !status Amendment 2012 11-03-11 !status ARG Approved 7-0-1 10-02-20 !status work item 11-01-30 !status received 10-07-14 !priority Low !difficulty Easy !qualifier Omission !subject Ancestor types for synchronized formal types !summary The ancestor type for a synchronized formal derived type must be a limited interface. !question There appears to be no rule forbidding a declaration like: generic type T is synchronized new Record_Type and Interface_Type with private; But the actual type for synchronized type has to be a task type, protected type, or a synchronized interface. A record type is not allowed. Should this be fixed? (Yes.) !recommendation (See Summary.) !wording Modify 12.5.1(5/2): ... The reserved word limited or synchronized shall appear only if the ancestor type Redundant[and any progenitor types] are limited types. The reserved word synchronized shall appear (rather than limited) if the ancestor type or any of the progenitor types are synchronized interfaces. {The ancestor type shall be a limited interface if the reserved word synchonized appears.} !discussion Even without any changes, any instantiation of such a generic would necessarily fail. But that seems silly; the error should be diagnosed earlier rather than later. Moreover, the similar case for private extensions is illegal by 7.3(8.1/2). Generally, we want to rules for generic formal types to mirror the rules for private types. So we add wording to make this illegal. !corrigendum 12.5.1(5/2) @drepl The @i of a formal derived type is the subtype denoted by the @fa of the @fa. For a formal derived type declaration, the reserved words @b shall appear if and only if the ancestor type is a tagged type; in this case the formal derived type is a private extension of the ancestor type and the ancestor shall not be a class-wide type. Similarly, an @fa or the optional reserved words @b or @b shall appear only if the ancestor type is a tagged type. The reserved word @b or @b shall appear only if the ancestor type and any progenitor types are limited types. The reserved word @b shall appear (rather than @b) if the ancestor type or any of the progenitor types are synchronized interfaces. @dby The @i of a formal derived type is the subtype denoted by the @fa of the @fa. For a formal derived type declaration, the reserved words @b shall appear if and only if the ancestor type is a tagged type; in this case the formal derived type is a private extension of the ancestor type and the ancestor shall not be a class-wide type. Similarly, an @fa or the optional reserved words @b or @b shall appear only if the ancestor type is a tagged type. The reserved word @b or @b shall appear only if the ancestor type and any progenitor types are limited types. The reserved word @b shall appear (rather than @b) if the ancestor type or any of the progenitor types are synchronized interfaces. The ancestor type shall be a limited interface if the reserved word @b appears. !ACATS test Add an ACATS B-test to check this issue. !appendix !topic Synchronized formal types derived from records? !reference RM05 12.5.1 !from Adam Beneschan 10-07-14 !discussion I think this is an error of omission: Nothing prevents a declaration like generic type T is synchronized new Record_Type and Interface_Type with private; even though this makes no sense---a synchronized type is a task or protected type and can't be derived from a record. The error is probably harmless since such a generic can't be instantiated anyway, but it certainly seems like this ought to be illegal. ****************************************************************