comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: I am leaving Ada :-( because of GNAT bugs
Date: Mon, 11 Dec 2017 16:47:26 -0600
Date: 2017-12-11T16:47:26-06:00	[thread overview]
Message-ID: <p0n1tv$sd8$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: lyy3mctfad.fsf@pushface.org


"Simon Wright" <simon@pushface.org> wrote in message 
news:lyy3mctfad.fsf@pushface.org...
> bj.mooremr@gmail.com writes:
...
>> 9. In rdf-redland-query_results.ads, you declare a type derived from a
>> tagged type, but then try to apply a Pre'Class aspect. This apparently
>> is not legal, though the GPL 2016 compiler doesn't complain. I ran
>> into this, with my own code, that GPL 2017 told me with a compiler
>> error that the code was not legal.
>>
>> Pre'Class can only be applied to a root type apparently.
>
> See ARM 6.1.1(17.1/4), "Pre'Class shall not be specified for an
> overriding primitive subprogram of a tagged type T unless the Pre'Class
> aspect is specified for the corresponding primitive subprogram of some
> ancestor of T."

That was a rule change in the 2015 Corrigendum. It was made because the 
derived Pre'Class will be ored with the inherited one, and if you've 
inherited from a routine with no Pre'Class, you are oring with True -- which 
means your new Pre'Class will be completely ignored.

Pre'Class makes sense mainly for a root class; one generally will use 
dispatching calls within it so it can adjust as needed for child types. If 
you need a precondition that doesn't fit into that model, you should use Pre 
(and be aware that you are violating the basic LSP approach).

                            Randy.



  reply	other threads:[~2017-12-11 22:47 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-07  7:45 I am leaving Ada :-( because of GNAT bugs Victor Porton
2017-12-07  9:54 ` Simon Wright
2017-12-09  8:53 ` bj.mooremr
2017-12-09  9:35   ` Simon Wright
2017-12-11 22:47     ` Randy Brukardt [this message]
2017-12-12 19:43   ` jm.tarrasa
2017-12-12 20:50     ` Dmitry A. Kazakov
2017-12-12 21:15     ` Paul Rubin
2017-12-13  7:01       ` Luke A. Guest
2017-12-13 17:46         ` Jeffrey R. Carter
2017-12-13 19:37           ` Jacob Sparre Andersen
2017-12-13 21:52             ` Jeffrey R. Carter
2017-12-14 12:54               ` Lucretia
2017-12-14 12:52           ` Lucretia
2017-12-14 13:44             ` Dmitry A. Kazakov
2017-12-14 14:53               ` MM
2017-12-14 16:43                 ` Luke A. Guest
2017-12-14 19:37                   ` MM
2017-12-14 17:01             ` Jeffrey R. Carter
2017-12-15 21:52         ` Paul Rubin
2017-12-12 22:57 ` Mehdi Saada
2017-12-13  6:43   ` Per Sandberg
2017-12-13  7:01   ` Luke A. Guest
2017-12-13  8:03   ` G. B.
2017-12-13  9:06     ` Dmitry A. Kazakov
2017-12-13 17:41   ` Jeffrey R. Carter
replies disabled

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