comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@acm.org>
To: comp.lang.ada@ada-france.org
Subject: Re: Odd error with access to derived types
Date: 16 Oct 2004 08:58:34 -0400
Date: 2004-10-16T08:58:34-04:00	[thread overview]
Message-ID: <mailman.1.1097931533.10401.comp.lang.ada@ada-france.org> (raw)
In-Reply-To: <drq0n0dlacjqiv7o14egont0dsg2ut8e37@4ax.com>

A.Imran <me5@privacy.net> writes:

> Thank you for looking at the code.  Here is the error message:
> 
> ~> gnatmake test
> gcc -c test.adb
> parent-child.ads:10:09: "derived_access" conflicts with declaration at
> line 6
> gnatmake: "test.adb" compilation error

That is certainly a confusing error message. I'd call it a compiler
bug; submit this to report@gnat.com.

As for working around it, this compiles:
package parent is

        task type a_task;

        type base_type is abstract tagged limited record
                dummy_task : a_task;
        end record;
        type Task_Access is access Base_Type'Class;

end parent;
package parent.child is

        type derived_type is new base_type with private;

--        type Derived_Access is access derived_type;

private

        type derived_type is new base_type with record
                dummy : boolean;
        end record;

end parent.child;

with parent.child;
procedure test
is
   My_Task : Parent.Task_Access := new Parent.Child.Derived_Type;
begin
        null;
end test;



-- 
-- Stephe




  reply	other threads:[~2004-10-16 12:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <feusm0hpbe5frsvljam7jbllqvftusc10v@4ax.com>
2004-10-14 19:17 ` Odd error with access to derived types Niklas Holsti
2004-10-15  1:28 ` Stephen Leake
2004-10-16  0:30   ` A. Imran
2004-10-16 12:58     ` Stephen Leake [this message]
2004-10-17  0:19       ` Brian May
2004-10-17  0:32         ` Stephen Leake
2004-10-17 12:14           ` A. Imran
replies disabled

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