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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1e514fb9f9333128 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-12 01:06:42 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: 402450@cepsz.unizar.es (Jano) Newsgroups: comp.lang.ada Subject: Re: Problem with access types using Booch components. Date: 12 Feb 2003 01:06:42 -0800 Organization: http://groups.google.com/ Message-ID: <5d6fdb61.0302120106.64e8a144@posting.google.com> References: <5d6fdb61.0302111021.73b4bc4a@posting.google.com> NNTP-Posting-Host: 80.58.47.42 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1045040802 19268 127.0.0.1 (12 Feb 2003 09:06:42 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 12 Feb 2003 09:06:42 GMT Xref: archiver1.google.com comp.lang.ada:34015 Date: 2003-02-12T09:06:42+00:00 List-Id: Jano <402450@cepsz.unizar.es> wrote in message news:... > En el mensaje , simon@pushface.org > dice... > > Hello, > > > What compiler/version are you using? > > I'm using Gnat 3.15p > > > With GNAT 3.15p I get this to compile without complaint (and to run, > > though it's not a thorough test!). > > Mmm, I get it also to compile, it's only at runtime that I get the > Constraint_error exception raised, saying "tag check failed" or the like > (sorry, I'm not at work where I have the sources to quote it exactly) > > > Note the 'Class .... > > I've noted it. Really, I was following the example in the docs very > closely because I've just begun to try it. > > Your example below it's exactly what I have, but I have it splitted > across some packages. I find it strange, specially because of the error > going away when I assign the access to a local container. > > Uhm! I see now a difference. You are getting the iterator from CU, which > is the unit who contains the type Collection. In the example in the docs > (and in my program) I'm getting the Iterator from the top > abstract_container. I suppose dispatching takes care of this? But what > about the different behavior in my case when using the access or the > local container? ARG! MY MEMORY FAULT ANOTHER TIME. I was taking the iterator from the same package you are. So the problem remains equal. Now I have the exact error wording: CONSTRAINT_ERROR: bc-containers-collections.adb:93 tag check failed > Thanks anyway, I'll try tomorrow to use the CU-level package... > > > with Collection_Test_Support; > > > > procedure Jano is > > > > use Collection_Test_Support; > > > > type CU_P is access all CU.Collection; > > > > C : aliased CU.Collection; > > CP : CU_P := C'Access; > > > > begin > > > > declare > > It : Containers.Iterator'Class := CU.New_Iterator (CP.all); > > begin > > null; > > end; > > > > end Jano;