From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.0 required=3.0 tests=BAYES_40,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.5-pre1 X-Received: by 2002:ad4:436b:: with SMTP id u11mr60157058qvt.21.1609418806311; Thu, 31 Dec 2020 04:46:46 -0800 (PST) X-Received: by 2002:a25:4148:: with SMTP id o69mr81074915yba.462.1609418806169; Thu, 31 Dec 2020 04:46:46 -0800 (PST) Path: eternal-september.org!reader02.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 31 Dec 2020 04:46:45 -0800 (PST) In-Reply-To: <6dd44b3c-b3de-4943-ac70-0e25eaf279efn@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=2a02:1206:4564:fe50:242a:ea29:1097:e4f2; posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG NNTP-Posting-Host: 2a02:1206:4564:fe50:242a:ea29:1097:e4f2 References: <3c1a2fe9-e8f2-401f-870d-aecd9e0f9c69n@googlegroups.com> <6dd44b3c-b3de-4943-ac70-0e25eaf279efn@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Question on variant/discriminated records From: Gautier write-only address Injection-Date: Thu, 31 Dec 2020 12:46:46 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:60988 List-Id: On Thursday, December 31, 2020 at 1:24:25 PM UTC+1, reinert wrote: > Here must be a hole in my understanding. I thought that the discriminant must be known > before V.Y := 1.0; and hence there should be no confusion? Imagine you have a function Evaluate (r : rec1_Type) return Float. Except in trivial cases like if r.option1 = b then result := result + r.y; end if; the compiler cannot guess the value of the discriminant.