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!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: how to force the Small aspect of a new type derived from the generic formal type ? Date: Wed, 24 Jan 2018 21:30:55 -0600 Organization: JSA Research & Innovation Message-ID: References: <1aaa851e-495a-4dd4-8db7-0fd84ee8225f@googlegroups.com> Injection-Date: Thu, 25 Jan 2018 03:30:56 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="28807"; mail-complaints-to="news@jacob-sparre.dk" 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.7246 Xref: reader02.eternal-september.org comp.lang.ada:50136 Date: 2018-01-24T21:30:55-06:00 List-Id: "Mehdi Saada" <00120260a@gmail.com> wrote in message news:1aaa851e-495a-4dd4-8db7-0fd84ee8225f@googlegroups.com... > Yet again... Look at this ! The teacher said: use Small > aspect/representation clause, and somewhere else he said to make the > package generic. I did both... > > generic > type Modele is delta <> ; > package Proba is > type T_proba is new MODELE range 0.1..1.0 with Small => Modele'Delta; > > gives us: representation item not allowed for generic type That's just what the error message says; you can't use most representation aspects on a type derived from a generic formal type. Even if you were not in a generic unit, you can't usually put representation aspects on a derived type (they usually have to match the original type). The representation aspects have to go on the original type (the one passed into the generic unit). ... > How do I do that ? Forcing the representation of a new type derived from > the generic formal type ? You can't do that; the derived type has to have the same representation as the formal type. Either the teacher is asking for the impossible (which, unfortunately IS possible), or you misunderstood the request. Randy.