comp.lang.ada
 help / color / mirror / Atom feed
* Variant record limitation - what's a better solution?
@ 2013-07-03  7:52 Peter Brooks
  2013-07-03  8:11 ` Georg Bauhaus
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Peter Brooks @ 2013-07-03  7:52 UTC (permalink / raw)


I see that I can't do what I'd like to with a variant record. What should I be doing?

Here's an example:

type
my_object(X : size_type) is
       record
              name : string(1..80);
              case X is
                 when small => Y : small_type; -- line 20
                 when medium => Y : medium_type; -- line 21
                 when large => Y: large_type; -- line 22
              end case;
       end record;

The errors are:
line 21  'Y' conflicts with declaration at line 20
line 22 'Y' conflicts with declaration at line 21

I was hoping to have a different type depending on the case, but this doesn't seem allowed. What would achieve this?

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

end of thread, other threads:[~2013-07-10  1:11 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-03  7:52 Variant record limitation - what's a better solution? Peter Brooks
2013-07-03  8:11 ` Georg Bauhaus
2013-07-03  9:39   ` Peter Brooks
2013-07-03 16:23 ` Jeffrey Carter
2013-07-03 18:35 ` Shark8
2013-07-03 19:26 ` Adam Beneschan
2013-07-09 11:48   ` Peter Brooks
2013-07-09 15:11     ` Adam Beneschan
2013-07-10  1:11       ` Peter Brooks
2013-07-03 20:55 ` Per Sandberg
2013-07-09  6:38 ` Peter Brooks
2013-07-09  7:49   ` Simon Wright
2013-07-09  8:22   ` Georg Bauhaus
2013-07-09 14:12   ` Eryndlia Mavourneen

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