From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!aioe.org!RKN7TKnHC01q0gdg6EhkbQ.user.46.165.242.75.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Discriminant problem Date: Thu, 09 Sep 2021 20:51:39 +0100 Organization: Aioe.org NNTP Server Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: gioia.aioe.org; logging-data="4500"; posting-host="RKN7TKnHC01q0gdg6EhkbQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org"; User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (darwin) X-Notice: Filtered by postfilter v. 0.9.2 Cancel-Lock: sha1:3D1MbS2J64xcvH63Pgtn/PFoS0I= Xref: reader02.eternal-september.org comp.lang.ada:62683 List-Id: "Randy Brukardt" writes: > "Jeffrey R. Carter" 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.