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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.107.12.227 with SMTP id 96mr15898394iom.106.1517437861615; Wed, 31 Jan 2018 14:31:01 -0800 (PST) X-Received: by 10.157.14.146 with SMTP id 18mr681683otj.10.1517437861512; Wed, 31 Jan 2018 14:31:01 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.am4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!w142no12649ita.0!news-out.google.com!k194ni31itb.0!nntp.google.com!g80no12384itg.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 31 Jan 2018 14:31:01 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=76.113.16.86; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 76.113.16.86 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Indefinite_Holders: bug or misunderstanding? From: Shark8 Injection-Date: Wed, 31 Jan 2018 22:31:01 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Bytes: 2433 X-Received-Body-CRC: 3210643092 Xref: reader02.eternal-september.org comp.lang.ada:50232 Date: 2018-01-31T14:31:01-08:00 List-Id: Hm, the error-message is straightforward: the compiler is expecting the full-definition of Str to have a discriminant. HOWEVER, I seem to remember* the partial-view ("type Str (<>) is private") as indicating only that the type is unconstrained, which the array actually is -- so if that's the proper interpretation then this is a compiler bug. * I could be misremembering; I don't think that the generic-parameter "Type Param(<>) is private" --------------------------------- PS -- Looks like a compiler error. Generic Type Test(<>) is private; With Function Image( Item : Test ) Return String; Package TTK is Procedure Print( Item : Test ); End TTK; Package Body TTK is Procedure Print( Item : Test ) is Begin Ada.Text_IO.Put_Line( Image(Item) ); End Print; End TTK; Type B is Array(Integer Range <>) of Integer; Function To_String(Object : B) Return String is Subtype Tail is Integer range Integer'Succ(Object'First)..Object'Last; Begin Return (Case Object'Length is when 0 => "", when 1 => Object(Object'First)'Img & '.', when others => Object(Object'First)'Img & ',' & To_String(Object(Tail)) ); End To_String; Package K is new TTK(B, To_String); --... K.Print( (5,2,3,1,7) ); ------------ -- OUTPUT -- ------------ 5, 2, 3, 1, 7.