Version 1.1 of ai05s/ai05-0237-1.txt

Unformatted version of ai05s/ai05-0237-1.txt version 1.1
Other versions for file ai05s/ai05-0237-1.txt

!standard 12.5.1(5.1/2)          11-01-30 AI05-0237-1/01
!class binding interpretation 11-01-30
!status work item 11-01-30
!status received 10-07-14
!priority Low
!difficulty Easy
!qualifier Omission
!subject Ancestor types for synchronized formal types
The ancestor type for a synchronized formal derived type must be a limited interface.
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.)
(See Summary.)
Modify 12.5.1(5/2):
... The reserved word limited or synchronized shall appear only if the ancestor type [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. {If the reserved word synchronized appears, the ancestor type shall be a limited interface.}
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)
!ACATS test
Add an ACATS B-test to check this issue.

!topic Synchronized formal types derived from records?
!reference RM05 12.5.1
!from Adam Beneschan 10-07-14

I think this is an error of omission:  Nothing prevents a declaration like 

      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.


Questions? Ask the ACAA Technical Agent