comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: compiler confusion, overloading and "subtype mark required in this context"
Date: Wed, 10 Feb 2021 21:03:51 -0600	[thread overview]
Message-ID: <s026qo$htu$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: 4360fbab-d22f-4a21-bc9b-aebe6b3c1faan@googlegroups.com

"Mehdi Saada" <00120260a@gmail.com> wrote in message 
news:4360fbab-d22f-4a21-bc9b-aebe6b3c1faan@googlegroups.com...
>> If I count corretctly, looks like a closing ) is missing at the end. Thus 
>> in the else part, you have
>> Rational*Integer.
> Ahhhh... I'm not used to these kinds of error messages ! I kinda 
> understand what happened later in functions then... just kind :-)
> Experiences makes good eyes... well I see myself getting better at it too.
>> Here you have Positive as a type name and as an enumeration literal.
> I saw, but it seemed to me the context was clear enough, I'm surprised 
> gnat doesn't agree with me.

Type names don't allow overloading. So if you have both an enumeration 
literal and a type name, you can only get one or the other (or neither in 
some cases). If you're using both, something has to be illegal. Only 
subprograms can be overloaded (enumeration literals are technically 
functions).

                               Randy.


      reply	other threads:[~2021-02-11  3:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-07  9:15 compiler confusion, overloading and "subtype mark required in this context" Mehdi Saada
2021-02-07 10:59 ` AdaMagica
2021-02-07 12:56   ` Mehdi Saada
2021-02-11  3:03     ` Randy Brukardt [this message]
replies disabled

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