comp.lang.ada
 help / color / mirror / Atom feed
* [Q] non-limited record and "self-pointer"
@ 2004-02-08 21:26 Georg Bauhaus
  2004-02-09  0:58 ` Stephen Leake
  0 siblings, 1 reply; 16+ messages in thread
From: Georg Bauhaus @ 2004-02-08 21:26 UTC (permalink / raw)



Is there any circumstance which might allow the following type
(Read_Only_Set) to be o.K.? The record isn't limited, the compiler
does not complain unless I remove the "container" component. It says
then that for correct instantiation the current instance must be a
limited type. Which has some words that I had thought it could say.
(Though, is there an instance that can be a type?)


   type Read_Only_Set is tagged private;

   type Set_Ptr is access constant Read_Only_Set;


private
   package Implementation is
      new Charles.Sets.Sorted.Unbounded(Element);
        -- (Element is generic formal private)

   type Read_Only_Set is tagged    <-- not limited
      record
         container: Implementation.Container_Type;

        -- line 102:
         self: Set_Ptr := Read_Only_Set'unchecked_access;  <-- no complaints
         --  used in value_in_place

      end record;

with "container: ..." removed:
Compiling: sets_test.adb (source file time stamp: 2004-02-08 20:45:06)

==============Error messages for source file: ../tests/test-containers.ads
    22.    package T_sets is new sets(T);
           |
        >>> instantiation error at sets.ads:102
        >>> current instance must be a limited type

(T is not limited)



TIA, georg



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

end of thread, other threads:[~2004-02-14  6:04 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-08 21:26 [Q] non-limited record and "self-pointer" Georg Bauhaus
2004-02-09  0:58 ` Stephen Leake
2004-02-09  2:56   ` Georg Bauhaus
2004-02-09 12:50     ` Stephen Leake
2004-02-09 15:45       ` Georg Bauhaus
2004-02-10  1:35         ` Dan Eilers
2004-02-10  2:30           ` Stephen Leake
2004-02-10  7:20             ` Robert I. Eachus
2004-02-11 18:41               ` Georg Bauhaus
2004-02-11 22:05                 ` Randy Brukardt
2004-02-12  0:21                 ` Robert I. Eachus
2004-02-12 20:44                   ` Georg Bauhaus
2004-02-14  0:25                     ` Robert I. Eachus
2004-02-14  4:09                       ` Robert I. Eachus
2004-02-14  0:24               ` Adam Beneschan
2004-02-14  6:04                 ` Randy Brukardt

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