From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ca6fa73fc39d4c65 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!d12g2000prj.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Text_IO.Text_Streams causing errors Date: Fri, 25 Feb 2011 09:34:24 -0800 (PST) Organization: http://groups.google.com Message-ID: <45dc1b39-3641-48fd-8d22-642f90832507@d12g2000prj.googlegroups.com> References: <17ddc153-6fd1-4fcb-b582-d93badeb22dd@e8g2000vbz.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1298655265 14506 127.0.0.1 (25 Feb 2011 17:34:25 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 25 Feb 2011 17:34:25 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: d12g2000prj.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:17600 Date: 2011-02-25T09:34:24-08:00 List-Id: On Feb 25, 7:14=A0am, Julian Leyh wrote: > Hi, i have some code that looks like this (stripped to minimal > example): > > -- bar.adb: > with Foo; > procedure Bar is > =A0 =A0Foobar : aliased Foo.Foobar; > begin > =A0 =A0Foo.Print (Foobar'Access, "Foobar"); > end Bar; > > -- foo.adb: > with Text_IO.Text_Streams; > package body Foo is > =A0 =A0procedure Print (This : access Foobar'Class; Prefix : in String) i= s > =A0 =A0begin > =A0 =A0 =A0 Text_IO.Put_Line (Prefix); > =A0 =A0end Print; > end Foo; > > -- foo.ads: > package Foo is > =A0 =A0type Foobar is tagged private; > =A0 =A0procedure Print (This : access Foobar'Class; Prefix : in String); > private > =A0 =A0type 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