comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Discriminant and type extensions
Date: Mon, 5 Oct 2009 16:08:23 -0700 (PDT)
Date: 2009-10-05T16:08:23-07:00	[thread overview]
Message-ID: <0d9da8c4-ab17-42b0-99ea-09ecf02435e5@x6g2000prc.googlegroups.com> (raw)
In-Reply-To: 220c069a-a09c-413f-811c-d3b00e1b6d7e@o13g2000vbl.googlegroups.com

On Oct 5, 3:34 pm, Yannick Duchêne Hibou57 <yannick_duch...@yahoo.fr>
wrote:
> Re- Not legal, the compiler don't want this

Referring to the example where you removed the genericity:

If you put this on *both* the private and full declarations of
Extension_Type:

  type Extension_Type (Discriminant : Natural) is
     new P1.T_Type (Discriminant => Discriminant)

then take the (Discriminant => Discriminant) off the *private*
extension declaration.  I.e.:

  type Extension_Type (Discriminant : Natural) is
     new P1.T_Type
     with private;

But leave it on the full declaration:

  type Extension_Type (Discriminant : Natural) is
     new P1.T_Type (Discriminant => Discriminant)
     with null record;

See if that works.

The reason has to do with a rule about statically matching
constraints.  See AARM 7.3(13.e), at http://www.adaic.org/standards/05aarm/html/AA-7-3.html
-- look for paragraph 13.e.

                                    -- Adam





  reply	other threads:[~2009-10-05 23:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-05 17:18 Discriminant and type extensions Hibou57 (Yannick Duchêne)
2009-10-05 20:42 ` Robert A Duff
2009-10-05 22:04   ` Adam Beneschan
2009-10-05 22:29     ` Yannick Duchêne Hibou57
2009-10-05 22:34       ` Yannick Duchêne Hibou57
2009-10-05 23:08         ` Adam Beneschan [this message]
2009-10-07  6:20           ` Yannick Duchêne Hibou57
2009-10-05 22:15   ` Yannick Duchêne Hibou57
2009-10-09  6:29     ` Yannick Duchêne Hibou57
2009-10-09 15:42       ` Jean-Pierre Rosen
2009-10-07  7:21 ` Jean-Pierre Rosen
2009-10-07 15:39   ` Yannick Duchêne Hibou57
replies disabled

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