1 -- Synchronized tagged types created by a private extension with the keyword
2 -- 'synchronized' shall be seen as an (immutably) limited tagged type, and
3 -- should therefore accept default disciminant spectifications.
4 -- This was a bug in earlier versions of GNAT, whereby GNAT erroneously
5 -- relied on a parent synchronized interface to determine limitedness
6 -- of a synchronized private extension. The problem being that a synchronized
7 -- private extension can derive a non-synchronized interface (specifically a
8 -- limited interface), Yet the RM makes it clear (7.3(6/2)) that such
9 -- synchronized private extensions are always limited.
11 -- Ergo: Default discriminants are of course legal on any synchronized private
16 procedure Sync_Tag_Limited
is
20 type Test_Interface
is limited interface
;
22 procedure Interface_Action
(Test
: in out Test_Interface
) is abstract;
27 package Implementation
is
28 type Test_Implementation
29 (Constraint
: Positive := 1) is
30 synchronized
new Ifaces
.Test_Interface
with private;
33 protected type Test_Implementation
34 (Constraint
: Positive := 1)
35 is new Ifaces
.Test_Interface
with
37 overriding
procedure Interface_Action
;
39 end Test_Implementation
;
42 package body Implementation
is
43 protected body Test_Implementation
is
44 procedure Interface_Action
is null;