comp.lang.ada
 help / color / mirror / Atom feed
From: "G.B." <bauhaus@futureapps.invalid>
Subject: Re: I'm facing an issue with: call to abstract procedure must be dispatching
Date: Tue, 8 Dec 2015 17:59:15 +0100
Date: 2015-12-08T17:59:15+01:00	[thread overview]
Message-ID: <n4724g$bqe$1@dont-email.me> (raw)
In-Reply-To: <8bc7fd76-f00a-4eea-9715-470af028fc84@googlegroups.com>

On 08.12.15 17:45, Serge Robyns wrote:

> procedure test is
>
>     type T_Store is new T_Asbtract_Store with null record;
>
>     overriding procedure Insert (Store  : in out T_Store;
>                                  Client : in     T_Client'Class) is
>     begin
>        null;
>     end Insert;
>
>     A_Store   : access T_Asbtract_Store;
>     The_Store : aliased T_Store;
>     Client    : T_Client;
>
> begin
>     A_Store := T_Asbtract_Store (The_Store)'Access;
>     A_Store.Insert (Client);
> end test;
>
> The compiler does not like "A_Store.Insert (Client)".
> Also with this construct I've to use an access variable ...
>
> Anyone can shed a light on this or suggest a smarter Ada way?

Just dispatch:

procedure test is

    type T_Store is new T_Asbtract_Store with null record;

    overriding procedure Insert (Store  : in out T_Store;
                                 Client : in     T_Client'Class) is
    begin
       null;
    end Insert;

    procedure Wanting_Some_Store
      (A_Store  : in out T_Asbtract_Store'Class;
       A_Client :        T_client) is
    begin
       A_Store.Insert (A_Client);
    end Wanting_Some_Store;

    Client    : T_Client;
    The_Store : T_Store;
begin
    Wanting_Some_Store (The_Store, Client);
end test;




  reply	other threads:[~2015-12-08 16:59 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-08 16:45 I'm facing an issue with: call to abstract procedure must be dispatching Serge Robyns
2015-12-08 16:59 ` G.B. [this message]
2015-12-08 17:04 ` Dmitry A. Kazakov
2015-12-08 17:24   ` Serge Robyns
2015-12-08 17:42     ` Dmitry A. Kazakov
2015-12-08 18:00       ` Serge Robyns
2015-12-08 18:22         ` Dmitry A. Kazakov
2015-12-08 20:21           ` Serge Robyns
2015-12-08 21:08             ` Dmitry A. Kazakov
2015-12-08 21:55               ` Serge Robyns
2015-12-08 22:43                 ` Serge Robyns
2015-12-08 22:55                   ` Jeffrey R. Carter
2015-12-09 23:03                     ` Randy Brukardt
2015-12-10  8:38                       ` Serge Robyns
2015-12-10 23:43                         ` Randy Brukardt
2015-12-09  8:48                 ` Dmitry A. Kazakov
2015-12-09 10:53               ` G.B.
2015-12-09 12:03                 ` Dmitry A. Kazakov
2015-12-09 13:42                   ` G.B.
2015-12-09 14:23                     ` Dmitry A. Kazakov
2015-12-08 22:55             ` Jeffrey R. Carter
2015-12-08 23:04               ` Serge Robyns
2015-12-08 23:42                 ` Jeffrey R. Carter
2015-12-09 13:40                 ` Jere
2015-12-09 13:48                   ` G.B.
2015-12-09 15:33                     ` Jere
2015-12-13 21:37                 ` Shark8
2015-12-14  2:20                   ` Jeffrey R. Carter
2015-12-15  7:26                     ` Shark8
2015-12-08 17:30 ` Jeffrey R. Carter
2015-12-08 17:48   ` Serge Robyns
2015-12-08 18:46     ` Jeffrey R. Carter
2015-12-08 20:28       ` Serge Robyns
2015-12-08 22:20     ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox