From: Jacob Sparre Andersen <sparre@nbi.dk>
Subject: Re: A problem with "interface"
Date: 05 Feb 2009 17:13:31 +0100
Date: 2009-02-05T17:13:31+01:00 [thread overview]
Message-ID: <87skmseuac.fsf@nbi.dk> (raw)
In-Reply-To: zvGdneFPpt7YnRbUnZ2dnUVZ8uednZ2d@posted.plusnet
Robert_Matthews wrote:
> In using interface types with GNAT I have encountered a problem.
> Consider the following packages:
>
> package Int is
>
> type A is interface;
> type B is interface;
>
> procedure P (Param1 : A; Param2 : B'Class) is abstract;
>
> end Int;
>
> with Int;
> package Client is
>
> type Client_A is new Int.A with null record;
> type Client_B is new Int.B with null record;
>
> overriding
> procedure Client_P (Param1 : Client_A; Param2 : Client_B'Class);
>
> end Client;
What procedure do you expect "Client_P" to override?
If you happen to want to override the procedure "P", you might want to
make sure the profile matches:
overriding
procedure P (Param1 : Client_A; Param2 : Int.B'Class);
Greetings,
Jacob
--
"They that can give up essential liberty to obtain a little
temporary safety deserve neither liberty nor safety."
-- Benjamin Franklin
next prev parent reply other threads:[~2009-02-05 16:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-05 15:05 A problem with "interface" Robert_Matthews
2009-02-05 16:13 ` Jacob Sparre Andersen [this message]
2009-02-05 16:14 ` Adam Beneschan
2009-02-06 14:08 ` Robert_Matthews
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox