Interfaces and private types



Hi again,

There is no compilation problem with the following code :

package Test_Interfaces is
type Int is synchronized interface;
procedure Init (I : in out Int) is abstract;
type T is new Int with private;
private
task type T is
entry Init;
end T;
end Test_Interfaces;

but, in a main program when I declare an object (i can't see it is a task) of type T, the compiler tells me that Init must be overriden. It is of course overriden by the entry of the task which is not explicitly visible. Having to provide Init explicitly prevents to hide the type of T although the syntax of the call (Obj.Init) is the same for a task entry or a procedure.

Does anybody know if there is a reason why in this case one cannot admit that Init is implicitly defined?

Philippe Tarroux

.



Relevant Pages