comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Text_IO.Text_Streams causing errors
Date: Fri, 25 Feb 2011 09:34:24 -0800 (PST)
Date: 2011-02-25T09:34:24-08:00	[thread overview]
Message-ID: <45dc1b39-3641-48fd-8d22-642f90832507@d12g2000prj.googlegroups.com> (raw)
In-Reply-To: 17ddc153-6fd1-4fcb-b582-d93badeb22dd@e8g2000vbz.googlegroups.com

On Feb 25, 7:14 am, Julian Leyh <jul...@vgai.de> wrote:
> Hi, i have some code that looks like this (stripped to minimal
> example):
>
> -- bar.adb:
> with Foo;
> procedure Bar is
>    Foobar : aliased Foo.Foobar;
> begin
>    Foo.Print (Foobar'Access, "Foobar");
> end Bar;
>
> -- foo.adb:
> with Text_IO.Text_Streams;
> package body Foo is
>    procedure Print (This : access Foobar'Class; Prefix : in String) is
>    begin
>       Text_IO.Put_Line (Prefix);
>    end Print;
> end Foo;
>
> -- foo.ads:
> package Foo is
>    type Foobar is tagged private;
>    procedure Print (This : access Foobar'Class; Prefix : in String);
> private
>    type Foobar is tagged null record;
> end Foo;
>
> Compiling it, I get this error:
>
> foo.adb:3:14: not fully conformant with declaration at foo.ads:3
> foo.adb:3:14: type of "This" does not match
>
> If I add -gnat05, the error disappears, and it disappears, too, if I
> add the "Ada." prefix to the "with".

and, I assume, changing the procedure call to
Ada.Text_IO.Put_Line(...)

> I know that I could remove the "Text_Streams", because it is not used
> at all, but I'm still a big confused about this error.
>
> Is it a compiler bug or did I do something forbidden?

Compiler bug.  There's certainly no way that adding Ada. to Text_IO
could possibly affect the legality of the "This" parameter.

                      -- Adam




      reply	other threads:[~2011-02-25 17:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-25 15:14 Text_IO.Text_Streams causing errors Julian Leyh
2011-02-25 17:34 ` Adam Beneschan [this message]
replies disabled

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