comp.lang.ada
 help / color / mirror / Atom feed
* how to force the Small aspect of a new type derived from the generic formal type ?
@ 2018-01-24 19:16 Mehdi Saada
  2018-01-25  3:30 ` Randy Brukardt
  0 siblings, 1 reply; 7+ messages in thread
From: Mehdi Saada @ 2018-01-24 19:16 UTC (permalink / raw)


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

I don't get it, since the RM states:
formal_complete_type_declaration ::= 
    type defining_identifier[discriminant_part] is formal_type_definition
        [aspect_specification];

Doing it otherwise:   type Modele is delta <>  with SMALL => MODELE'DELTA;
gives a more precise warning: aspect "Small" not allowed for formal type declaration.

How do I do that ? Forcing the representation of a new type derived from the generic formal type ?

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-01-26 11:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-24 19:16 how to force the Small aspect of a new type derived from the generic formal type ? Mehdi Saada
2018-01-25  3:30 ` Randy Brukardt
2018-01-25 12:54   ` Mehdi Saada
2018-01-26  4:38     ` Randy Brukardt
2018-01-26 11:13     ` Alejandro R. Mosteo
2018-01-25 18:35   ` G. B.
2018-01-26  4:42     ` Randy Brukardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox