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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!newsfeed.fsmpi.rwth-aachen.de!reality.xs3.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Why this program does not compile? (iterators) Date: Fri, 22 Aug 2014 18:39:34 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1408750775 30226 69.95.181.76 (22 Aug 2014 23:39:35 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 22 Aug 2014 23:39:35 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:21869 Date: 2014-08-22T18:39:34-05:00 List-Id: Looks OK to me, probably a compiler bug of some sort. - Randy. "Victor Porton" wrote in message news:lt7u1i$6bn$1@speranza.aioe.org... > Why this program does not compile? > > gnatgcc -c -g -O2 -gnat2012 -g -O0 -gnato -fstack-check -gnatVa > special_test.adb > : In function 'Special_Test': > : error: aggregate value used where an integer was expected > > with Ada.Iterator_Interfaces; > > procedure Special_Test is > > type My_Description_Cursor is null record; > > function Has_Element (Position: My_Description_Cursor) return Boolean is > (False); > > package My_Description_Iterators is new > Ada.Iterator_Interfaces(My_Description_Cursor, Has_Element); > > type My_Description_Iterator is new > My_Description_Iterators.Forward_Iterator with null record; > > overriding function First (Object: My_Description_Iterator) return > My_Description_Cursor is (null record); > overriding function Next (Object: My_Description_Iterator; Position: > My_Description_Cursor) return My_Description_Cursor is (null record); > > My_Iterator: My_Description_Iterator; > > begin > for C in My_Iterator loop > null; > end loop; > end; > > > -- > Victor Porton - http://portonvictor.org