Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ada > #49464

Re: Discriminant problem

From Simon Wright <simon@pushface.org>
Newsgroups comp.lang.ada
Subject Re: Discriminant problem
Date 2021-09-09 20:51 +0100
Organization Aioe.org NNTP Server
Message-ID <lyilz9bk8k.fsf@pushface.org> (permalink)
References <lytuj8dqya.fsf@pushface.org> <sgjkj4$kn4$1@dont-email.me> <sgk236$drg$1@franka.jacob-sparre.dk>

Show all headers | View raw


"Randy Brukardt" <randy@rrsoftware.com> writes:

> "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org> wrote in message 
> news:sgjkj4$kn4$1@dont-email.me...
>> On 8/29/21 8:51 PM, Simon Wright wrote:
>>>
>>> the compiler says
>>>
>>>     value for discriminant "Node_Test" must be static
>>>     non-static function call (RM 4.9(6,18))
>>
>> This has always been the rule for aggregates.
>
> But Ada 202x relaxes it slightly. If the expression has a static
> nominal subtype, and every value in the subtype selects the same
> variant, then a dynamic discriminant is allowed in a aggregate. I
> don't know if that is what is happening here or not; this relaxation
> doesn't come up that often.

That's exactly what's happening here.

Back to comp.lang.ada | Previous | NextPrevious in thread | Find similar


Thread

Discriminant problem Simon Wright <simon@pushface.org> - 2021-08-29 19:51 +0100
  Re: Discriminant problem Simon Wright <simon@pushface.org> - 2021-08-30 09:13 +0100
  Re: Discriminant problem "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org> - 2021-08-31 00:03 +0200
    Re: Discriminant problem "Randy Brukardt" <randy@rrsoftware.com> - 2021-08-30 20:53 -0500
      Re: Discriminant problem Simon Wright <simon@pushface.org> - 2021-09-09 20:51 +0100

csiph-web